MATLAB Answers

"Attempt to reference field of non-structure array" error when using Makemid Command

1 view (last 30 days)
Manigandan on 19 Sep 2016
Commented: Manigandan on 19 Sep 2016
I am trying to use makemid for creating MATLAB instrument driver for my Rohde and Schwarz Signal Analyzer. I have installed the IVI driver for the same. It gives me the following error "Attempt to reference field of non-structure array" error!. I am unable to understand what causes this error.
the syntax for using makemid command is makemid('Driver name','file name')


Sign in to comment.

Accepted Answer

Luuk van Oosten
Luuk van Oosten on 19 Sep 2016
I'm not really sure, because your question does not give much specific information about your situation (such as the actual name of the driver, that would be nice to have). My best guess: you are trying to access some kind of driver file using this thing you provided:
And the following is the case:
It could be that in your 'filename' you have for example the full path of your file as follows:
If your file is not a file with the extention .mdd, but for example a .txt file, this could give erros if you do not specify the file extention in the filed 'type'. Another possibility is that the name of your file 'yourfilename' accidentally contains a dot (i.e.: 'your.filename.mdd'). That might cause MATLAB to read it as a struct (while it is not) and therefore throws you an error.


Manigandan on 19 Sep 2016
OH am sorry for not mentioning the driver name!! I have installed the IVI-Com driver RsFs which is the IVI driver for Rohde and Schwarz FSIQ signal analyzer. I have actually mentioned the full driver path in this, but the question in this is the location for saving this driver, i.e. the one we make with
makemid('RsFs','c:/program files / MATLAB / ...filename.mdd')
The directory should be in the matlab folder or with the IVI-Com drivers? I tried giving it in the same directory as the source file, still it shows me the error.
Luuk van Oosten
Luuk van Oosten on 19 Sep 2016
It should not really matter, if you would do the following:
It makes the driver in the current working directory.
If you would do the following:
The driver 'RsFs' driver should be put into that folder.
Maybe have another look at the makemid documentation.
Manigandan on 19 Sep 2016
The above is a screenshot of my matlab command window Luuk. If you notice i followed the steps and it still throws me the error. May be something which i didnt see in this. I have read the weblink that you sent earlier as well, but i am not able to figure this out. Your help is much appreciated.

Sign in to comment.

More Answers (0)

Sign in to answer this question.