07-17-2013 01:55 AM
Hi! I have two problems with the formula node. I want to realize a sine function and show it on the graph.
The first problem is that i'm not able to wire the output (x) with the Waveform graph, the second one is the error in the formula node but i think that it is written properly since i took it from one of my teacher's example.
I have attached the VI. can you give a look at it? Thank you in advance.
Salvatore
Solved! Go to Solution.
07-17-2013 03:25 AM
Hi Salvatore,
your output x is just one single value, but a Graph accepts an array of values.
n is not defined in your formula node; just change the formula node's input "length" to "n" and delete the first row.
Regards,
Alex
07-17-2013 03:37 AM
Hi Alex,
the first row is important to create the "time dimension", if I delete it i'll have as result a line with all 1 and not the cos function as I wish.
About the output I have understood that it is a single value but probably I haven't done the right question that is:why isn't it an array? and is it possible to switch it into an array?
Thank you
07-17-2013 07:30 AM
First of all, your output will always be 1 (cos(2*pi*x) = 1). Are you sure about your formula? Secondly, just do it in LabVIEW.
07-17-2013 08:05 AM
first i want to learn the formula node
second:
considering n=t that goes as it was written from 0 to length (lenght could be 100) and a = 50Hz is it always 1? i think not... 🙂
07-17-2013 08:26 AM
Like crossrulz said, if n is an integer, the output all always be 1:
07-17-2013 08:36 AM
mmm and what formula should I use? In matlab i used to do cos(2*pi*f*t)
07-17-2013 10:03 AM
@s.turino84 wrote:
mmm and what formula should I use? In matlab i used to do cos(2*pi*f*t)
And also in Matlab you probably used fractional seconds. Something like 0:0.1:1 (it has been awhile since I did Matlab, I think that's the correct formatting) would result in an array from 0 to 1 in 0.1 steps.
07-17-2013 10:29 AM
I don't see where you attempted to define a Loop within the formula node.
07-17-2013 10:42 AM - edited 07-17-2013 10:44 AM
I guess the formula is ok, but you need a loop to create an array.
Here's what I had in mind:
but remember crossrulz, if A is an integer, the result will always be one.