Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have four curves for four different times as shown below in the figure. I need to draw the curve for time in between the given times e.g., I need to plot the curve for $t= 3$ and $t=10$ in matlab (this is just an example shown in below figure).

Is it possible, if so, please suggest something. A big thank you.$\sin(xt)$ vs $x$ where $x=[0,\pi/2]$ at different time $t$

share|cite|improve this question
So basically you just want to plot $\sin(3t)$ and $\sin(10t)$ (perhaps in the same plot)? – Eff Apr 9 '14 at 12:03
You can look at interpolating, but it might not work if the functions are like the sin waves in your example. You'd have to provide more context and details for any real help. It's too dependent on what the functions are to give a general answer. – AnonSubmitter85 Apr 13 '14 at 0:44

If I interpret your question correctly, you want to plot f(t,x)=sin(t*x) for various values of t and x? Am I right? If so, the following code creates a quite extensive graph with f(t,x) evaluated for many values of t and x, but a few values of t and x are marked.

The command mesh(X,Y,Z) can make 3D plots of {X,Y,Z} data.

close all







% the blue mesh plot

xlabel t
ylabel x
zlabel z

set(gca,'View',[50 70])

% the plot with t=[1 5 11 17] marked
for tToFind=[1 5 11 17]
    k=[k find(T==tToFind)];

hold on

% the plot with x=[.1 .25 .6 .8] marked
for xToFind=[.1 .25 .6 .8]
    k=[k find(X==xToFind)];


Plot generated by code

Please use the Rotate 3D button in the Figure window to rotate the view of the 3D plot, then you will get a better feeling for what is plotted. You might also want to maximise your Figure window. Remember to look at the axis labels, to see where the t- and x-axes are while rotating.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.