필터 지우기
필터 지우기

How to plot using data stored in a .mat file?

조회 수: 4 (최근 30일)
Del
Del 2013년 1월 24일
I have created a .mat file (variable) and it contains 2 columns, each one has 11 numbers. I want to plot column 1 (X axis)against column 2 (Y axis). The problem is whenever I try to plot, it gives me a figure with 2 curves. Both curves have the same X-Axis (numbers ranging from 1 to 11), and the Y-values for the first curves are numbers in my first column, the Y-values for my second curve are numbers in my second column.
This is not what I am looking for, What I want is just one curve with X-values from my first column and Y-values coming from the second column. I have tried to change the values for the X axis and Y axis using the 'edit plot', but it is not working. Any idea?I cannot figure out how to make it work. Any ideas?

채택된 답변

Image Analyst
Image Analyst 2013년 1월 24일
Did you try
x = yourArray(:, 1); % Y of your first curve.
y = yourArray(:, 2); % Y of your second curve.
plot(x,y, 'bo-');
or this
scatter(x, y);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by