Plotting Multiple Pictures with Points from a Matrix in MATLAB

  • Context: MATLAB 
  • Thread starter Thread starter maxmilian
  • Start date Start date
  • Tags Tags
    Matlab Matrix Plot
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
7 replies · 6K views
maxmilian
Messages
12
Reaction score
0
Hi all

I am novice MATLAB programmer, and I need alittle help with plotting points, given in a txt. file.

I have a text file containing 56 points for 40 pictures. I've loaded the txt file by "load -ASCII nameofthefile.TXT" - and thereby created a matrix <112x40 double> the first 56 rows are x and rows from 57 to 112 are the y. My question is how do I plot each of these 40 pictures each containing the 56 points ?

kind regards

Maxmilian
 
on Phys.org
Thanks for your nice reply - what would I need to do if I wanted to have multiple plots in the same figure ?
 
subplot is unfortunately not what I need. I need the plots to overlap each other
 
You'll have to call the axes by handle then:

ax.(sprintf('%i',i)) = axes;

Thn you can set their position manually:

set(ax(sprintf('%i',i),'Position',rect);

Where rect is a four element vector of the four corners. Try googlIng "axes properties"
 
I resolved it by using "hold on"
But I am getting a error with my function when I am trying this ;

function figureplot(m)
load -ascii shapes.txt

for i=1:m
...

? Input argument "m" is undefined.

What I am trying to do, is making a function where I can tell it how many plots I want in a single figure. So by calling figureplot(5) - it would plot 5 plots in a figure.
 
Oh! you wanted them to overlap all in the same place...? Why don't you just plot them all at once?

I don't see a problem with what you've posted. I usually don't use the -ascii flag and haven't had problems, but maybe it's something you do elsewhere in your code?