01-30-2013 12:50 PM
x = 0:0.5:1
params = [0 0.5 1]
for i=1:length(x)
if x(i)<params(1)
y(i)= 2 * abs(x(i) - 0.5);
elseif x(i)<params(2)
y(i)= 2 * abs(x(i) - 0.5);
else x(i)<params(3)
y(i)= 2 * abs(x(i) - 0.5);
end
end
out=y';
plot(x,out)
I have a this simple program.
How to plot this in LABVIEW block diagram or Front panel.?
How the plot will look like is attached here.. please help..
01-30-2013 01:22 PM
What have you done so fare ?
How much do you know about LabVIEW ?
I will give you some clues: For loop, Autoindexing, Ramp, basic math, and a xy-graph.
01-30-2013 11:13 PM
Hi means,
Its very simple but tell me why line 5,7,9 statements are same, It is else part so it should be different from each other right ?
Doesnot make any sense.
01-31-2013 07:21 AM
It will be same because
length(x)= 3
so if x(1)<params(1)
y(1) = 2* abs(x(1) - 0.5)
and so on..
Here i will be maximum 3 and same params is also 3
01-31-2013 07:23 AM
I am totally new to labview and want to enter in this field.
Before this i just seen a demo from NI person that taking one knob and connecting it to meter..
Ok.. I will try now with the elements you given and will come back here..
02-01-2013 11:27 AM
I think Ranjeet meant that since the equasion in the cases is identacle you don't need the If. Or For loops or params[] at all and a postage stamp size BD is all that you need.