matrix plotting

조회 수: 1 (최근 30일)
Zach
Zach 2011년 5월 17일
If I have a matrix x=[1 2 3 4] and a vector y=[1 4 9 16] and make the matrix z=[x; y] what is the equivalent matrix plot of z to scatter(x,y).

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 5월 17일
scatter(z(1,:),z(2,:))
or
scatter(z(1:2:end),z(2:2:end))
%Sorry misread your inputs
  댓글 수: 1
Zach
Zach 2011년 5월 17일
For that to work it would have to be scatter(z(1:(numel(z)/2)),z((numel(z)/2)+1:end)) but that's not what I'm trying to plot. I want to row 1 vs. row 2. Is there a way to call the row of a matrix?

댓글을 달려면 로그인하십시오.

추가 답변 (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