LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How To Build a matrix of zeros

Hello,

 

I am trying to build a tsunami Simulator and I need to create an empty matrix of zeros for the three variables u,v and b. How do I go about doing this?

 

The code I need to enter is: 

% Build empty u, v, b matrices
u=zeros(length(x), length(y), length(t));
v=zeros(length(x), length(y), length(t));
b=zeros(length(x), length(y));
h=zeros(length(x), length(y), length(t));

 

 

Thanks

Sam

0 Kudos
Message 1 of 4
(4,505 Views)

You probably mean array, as matrices are 2D arrays in LV, so that won't apply to your 3D example.

The Initialize Array function in the Array palette will do the job:

 

ScreenHunter_005.jpg

 

In your case, expand it to 3 dimensions:

 

ScreenHunter_004.jpg

Message 2 of 4
(4,502 Views)

Thank You Very Much

0 Kudos
Message 3 of 4
(4,486 Views)

Remember to mark a post as a Solution if it solved your problem (and give Kudos where appropriate Smiley Wink)

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 4 of 4
(4,478 Views)