Hi,
I read a bunch of topics everywhere, and even videos on YouTube, but I still don't understand how to use global variables. My teacher is actually asking me to plot 3 graphics using the function you see below, with 3 different values of "h". I added "." into function because one of the criteria is that the function must accept vectors. I MUST USE global variables for this exercise.
I have this function:
F(x)=1./(((1-x.^2).^2+h.*x.^2).^(1/2));x=linspace(0.1,2);
Now I need to associate 3 values to "h". In my case those values are:
h=[0.015625, 0.1, 0.5]
I won't put what I did here because this has no sense at all. So I would really appreciate someone who is able to give me an example.
At the end, I plotted the graphic this way:
plot(x,f(x));
Now when I want to use
function F(x)=[h]global hh=0.015625end
This is where everything collapses. I'm getting confused of how to plug values in my function F(x), and I mix up everything.
Could you please help me?
By the way I apologize if my sentences might be hard to understand — I'm not English.
Best Answer