I have seen examples of listbox that show how they open pics and files, but i want to show a graph(In this case a sawtooth wave). After some maths for the fourier series this is what i have and it works in the editor:
clear,clc;t=(0:0.01:10);n=input('número de harmónicas: ');Vo=0.5;Wo=2;Vn=Vo*ones(1,length(t));for k=1:1:n Vn=Vn-1/k/pi*sin(k*Wo*t);endplot(t,Vn)
When you run this, you introduce a number and will show you a graph. For the GUI part, i put a listbox with some numbers (10,20,30) as "n". What i want to do is that when i select the number, the graph of the series shows in the axes. I dont know where should i put my "cycle for", i tried using switch-case in the listbox but im not sure what is the opening function. How can i made my gui work for this case?? If there's another way? but my teacher want the listbox for the "n" values. I hope you understand, english is not my main language. Thanks in advance.
Best Answer