Madinat al-Muslimeen Islamic Message Board

A R C H I V E S

Matlab help!?

Madina Archives


Madinat al-Muslimeen Islamic Message Board

Matlab help!?
Anonymous
07/24/03 at 03:14:47
Assalamu alaikum,

Anyone here uses matlab?

I have a script that someone passed
on to me, and I am trying to improve
it.

Basically my question is :
- how can plot more than one
graph on the *same* page?

what i have right now is that each
plot is appended to a .ps file, but
each plot is on a separate page. i would
like them to be on the same page. is
this possible?

data is in an array format e.g.:

x1 y1.1 y1.2 ... y1.9  
x2 y2.1 y2.2 ... y2.9
x3 y3.1 y3.2 ... y3.9

jazakum Allah khair.
wa assalamu alaikum
Re: Matlab help!?
superFOB
07/24/03 at 07:18:59
[wlm]

Let me rephrase your question. You want a single figure with all your graphs on it, right? Not only you can have multiple plots on one figure, you can also plot multiple loci on the same graph. You can achieve the former using subplot system function and the latter using the plot command. Here is an example for your case:

x = 1:(2*3.141)/100:2*3.141
subplot(2,1,1), plot(x, sin(x))
subplot(2,1,2), plot(x, cos(x))

This plots two well known graphs on a single figure in one column. the parameters to subplot are the # of rows, # of cols, and the position index, in that order. Please consult the online help available free at matlab's website. This code should run as is. Let me know if you can't run this code.
NS
07/24/03 at 07:19:31
superFOB
Re: Matlab help!?
Anonymous
07/28/03 at 05:02:32
Assalamu alaikum

Jazak Allah khair br. SuperFOB.

The subplot command is the correct
command to use.

I was, however, plotting the same
function over and over for all the
data points (there was a loop),
so I was puzzled as to the value
of p to use (as in subplot (m n p) )

I finally figured it out.

Jazak Allah khair for replying.
It helped!

Take care
wa assalamu alaikum
Re: Matlab help!?
Al-Basha
07/31/03 at 03:21:22
[slm]

ugh matlab is the suck, i dunno how you guys can stand to code with it.


Madinat al-Muslimeen Islamic Message Board
A R C H I V E S

Individual posts do not necessarily reflect the views of Jannah.org, Islam, or all Muslims. All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the poster and may not be used without consent of the author.
The rest © Jannah.Org