10-06-2019 11:28 AM
I cannot run or debug pictures.
10-07-2019 12:17 AM
Sorry, the sub vi is attached bellow.
10-07-2019 10:11 AM
Your subVI is just a mess. All it generates is a 2D complex array with a single column and only a RE part. There is no need for 2D complex. Also, the X axis would need to be calculated only once, of course. I am sure it could be done in plain LabVIEW with a stack of two small FOR loops. No need for mathscript.
In a nutshell, here's how you would generate your xy graph data. Of course your subVI could just return the 1D DBL array instead (Or even the pink cluster).
10-08-2019 04:33 AM - edited 10-08-2019 04:35 AM
Thank you so much for your kind guidance.
I cleared all the things as mentioned.
Now one problem is that for small data it is fine but for large data it takes long time to compute. Is this the problem of math script?
I have tried in plain LabVIEW but i am stucked there in the end for which i came to math script and not working. I have translated the matlab code to plain Labview code.
Can you please review the vi's please.
I have attached the vi's. Hope will get kind response.
Thank you.
10-08-2019 11:25 AM - edited 10-08-2019 11:45 AM
You are making horrible performance choices. For example, why would you read a large array via local variables in a tight inner loop instead of just using a wire? The compiler needs to assume that the array can change at any time and thus needs to re-read it from scratch with every iteration. If you use a wire, LabVIEW can constant fold the array for the duration of the loops.
On a side note, index array is resizeable, no need for two instances. You should also mind representations and not mix orange and blue wires. Don't wire N if you are autoindexing.
In fact all your local variables should be eliminated. Once you exclusively use wires, the execution order is determined by dataflow and you can also eliminate the sequence structure. And yes, plain g-code is faster than mathscript and once you get rid of it, It is also much faster to load the program into memory.
10-09-2019 01:21 AM
Hi. Thank you.
Still i am facing problem in execution. In translation of matlab code to plain labview, in last i am facing problem.
matlab code:
sigma2 = sigma2./repmat((2*T.^2.*(N-2*m)),1,M);
sigma = sqrt(sigma2) ;
i used mathcript for this but not working and i stucked here to convert it to labview code.
the rest code is translated as in previous vi i shared.
i removed the local variables but once this last part is cleared then the code will be executed.
It gives the following error while execution.
The vi is also attached.
Thank you.