12-24-2012 12:44 AM
Thanks.. Here's the matlab code and the vi is attached. When I make changes, I start getting errors like matrix dimension exceeded. error 1050, 1047. I restart matlab and it starts to work but same strategy doesn't apply everytime. Can someone plz tell me what's going on inside which stops the program?
Matlab
S=400;
n_eff_re=linspace(0.5,1.5,S);
n_eff_im=linspace(0.06,0.15,S);
12-26-2012 06:35 PM
Hi kikki,
I would recommend checking out these KnowledgeBase Articles for common reasons for these errors:
Why Do I Get Error 1047 When Trying to Use The MATLAB Script Node in LabVIEW?
Error 1050 Occurred in MATLAB Script Node: Complex Values Cannot be Converted to Chars.
Like altenbach and RavensFan suggested, have you tried transposing the array to see if this resolves the issue?
04-17-2014 09:43 AM - edited 04-17-2014 09:44 AM
Hello!
I know this thread is old, but it seems am experiencing some similar problems. But even simpler.
I have some recorded data, at 100Hz, and I load them and compute the derivative. In Matlab is pretty smooth (I am executing with only disctrete time samples and so on, and when I zoom I can see the stairs each 0.01s, so is fine), but when the same is done in Labview I can see some short of "undersampling", which does not occur all time, and therefore the derivative goes crazy. I attach the graph cmparison for 10sec. Top is matlab (yellow uploaded siganl and magenta de derivative) and down is labview (white uploaded signal and red derivative).
04-17-2014 10:53 AM
We probably would need to see some code. Make sure to use exactly equivalent functions in both scenarios.
04-18-2014 02:06 AM
Hello, thank you for your reply. I actually use the same code, because I am usig formula Node in Labview and a script in matlab. Basically what it does is:
TS[1]=-RawData[4]*pi/180;
TS[2]=(TS[1]-TS_Ant[1])/T;
TS[2]=(T*TS[2]+0.02*TS_Ant[2])/(0.02+T);
So is extracting one elemnt of a big vector and computing the filtered derivative. Actually RawData is a big matrix with 4000samples of a 11 element vector. So I use a foor loop to extract sequentially each item
04-18-2014 02:11 AM
How hard would it be to attach actual code?
04-18-2014 02:50 AM
Sorry, I did not want to fill everything with uploads. Here I attache the Labview program I am using to figure out what is wrong
I think maybe is something it does when uploading the RawData into de model...I cannot upload the RawData, is too big 😞
04-18-2014 08:42 AM
Did you adjust for the fact that Matlab array indexes start at 1 while LV array indexes start at 0?
Lynn
04-18-2014 08:44 AM
Yeap, I took special care with that
04-18-2014 10:20 AM
can you attach a small input file that has only 2 or 3 rows?
Can you tell us what the matlab output is for this data?
Can you also show us the matlab code?
(Some quick glances: I would eliminate the local variable "T" and wire directly to thet terminal. Now you can even delete the big sequence structure. Why is "TS_Ant" initilized with an array of size 155? You never seem to go that high. The first element of the TS array written to the output file will always be zero, is that intentional?)