how to plot a function on each axis in matlab?

Dear All,
I've been having difficulty with this one. All the examples refer to making a meshgrid with x, y , then those last two gets mapped onto the function z(x,y)
however I want to do something totally different. I'd like to plot each function
1st Axis X: 1st function g(t,u) where t on [0 : tstep: 10] , u = [-10: ustep : 10] ;
% do we just do a meshgrid for those two ranges first off?
2nd Axis Y: 2nd function log10(g(t,u)) for log defined on [-1 :logstep: 1]
3rd Axis Z: time progression t from [0 : tstep: 10]
I need to study the function g(t,u) in respect of its Log10 as time progresses, hopefully it would make more sense with the following pseudo code:
define g(t,u) on [-10:gstep:10] , t on [0 : tstep: 10] , u = [-10: ustep : 10] ;
define log10(g(t,u)) on [-1 :logstep: 1]
define t on [0 : tstep: 10]
plot3D ( g(t,u) , log10(g(t,u)) , t) ; % that's the Target End Result

5 Comments

Which axes should be used for changes in u ?
Your third axes is one of your independent variables.
Your second axes is log() of the first axes
Your first axes is g(t,u) where you have defined the range of t but not of u.
Most common would be to make one of the axes t, one of the axes u, and the third axes g(t,u) or log(g(t,u))
Hello sir,
I'd like to thank you for your swift reply.
I know that my independent varaibles are u, and t. in my special case, I have to plot the two functions g(t,u) , along with log10(g(t,u) ) with the time progression t.
thus, in my special case, I am not interested to plot changes of u. (which is the essence of my question).
yes sir most common, in all matlab examples they'd take t , u , g(t,u)
however, in my case study, I am interested in studing g(t,u) , log10( g(t, u) with its time t.
"I need to study the function g(t,u) in respect of its Log10 as time progresses"
You would do that by using t on the x axis, u on the y axis, and log10(g(t,u)) on the Z axis, possibly followed by using view() to show the x/z plane .
view would be helpful, thank you.
However that does not help in visualizing the relationship between g(t,u) & log10(g(t,u)) ( with t)
The relationship between g(t,u) and log10(g(t,u)) is log10.
You could create two plots, one log10 and the other not log.
If you want to plot log10(g) and g as if they are two independent variables, then you will need to explain how you want to collapse all of the differences caused by u onto a single axes. For example, is it acceptable to plot t, max(g(t,u) over u), log10(max(g(t,u) over u)) -- a "maximum intensity projection" ?

Sign in to comment.

Answers (0)

Asked:

on 23 Aug 2019

Commented:

on 24 Aug 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!