04-16-2012 12:28 PM
I have the following matlab script, whereby I am trying to input it into labview without using the MathScript or Matlab Script nodes. Do you have any idea how??
----- I understand that below 3D matrices don't exist in LabView so I attempted to use a index array and initialize array functions.
% Build empty u, v, b matrices
u=zeros(length(x), length(y), length(t));
v=zeros(length(x), length(y), length(t));
h=zeros(length(x), length(y), length(t));
% Define initial condition
04-16-2012 12:56 PM - edited 04-16-2012 12:57 PM
Initialize array (resized for three indices, except for "b", which is 2D) is the correct tool to create the 3D arrays. To fill them with data, use "replace array subset". Possibly in a loop if needed.
See how far you get.
04-17-2012 09:31 AM
Hi, I attempted it as you said, however I am a little unsure as how to wire the values of the 'replace array subset' with the 'Initialize array'.
I'm sorry my attempt is a little pathetic but I have no knowledge of labVIEW what's so ever. please find it attached.
Thank you very much
04-17-2012 09:40 AM
I am curious what possesed you to make all three dimensions "infinite". You are guaranteed to run of of memory (inf coerces to 2^31), so you are actually trying to allocate 9,903,520,314,283,042,199,192,993,792 bytes!
As I said, the 3D array need to go in a shift regsiter of a loop where you replace the calculated values for the desired elements.
04-17-2012 09:54 AM
OK so if I place the values through a shift register would that mean that I can only access one value at a time? The reason I need to be able to access all values is because im initializing the array to store values for a 3d graph. Would I still be able to do so?