basic matlab prob

Thread Starter

ddonn

Joined Feb 10, 2010
13
Hi,

I am completely new to matlab. I have been given a simple task to plot a graph(frequency over time) and at the max value of frequency i have to print out the corresponding time value to the command window.

So far I have plotted the graph with the values im using and got the max value of the frequency. I am trying to use a while loop to get the time value,
c = max(F)
while (F == c)

end;

Can anyone tell what i need to put between while and end to print the corresponding time value to command screen if time variable is defined as T.

Thanks in advance
 
I am sure there is an easier way to do this... but i can't think right now.

you should try something like this:

Rich (BB code):
for i = 1:length(F)
    if (F(i) == max(F))
        T(i)
    end
end
Also, you should use the 'code' tags to keep formatting :)
 
Top