Defining column vectors for plotting from a single data source
조회 수: 5 (최근 30일)
이전 댓글 표시
I'm very new to Matlab and I'm just trying to plot data in the simplest way by importing a spreadsheet of column vectors. When using the workspace GUI to plot the data matlab does not know what columns are X, Y, and Z for instance. How do I define them so I don't have to create a bunch of individual vectors.
Thanks,
Mike
댓글 수: 0
채택된 답변
Fangjun Jiang
2011년 12월 8일
I don't know how to choose the column using workspace GUI for plotting, but it should be easy using MATLAB command.
A=magic(10);
figure; plot(A(:,3)); %plot the third column
figure; plot(A(:,1),A(:,5)); % plot using first column as X and 5th column as Y
댓글 수: 2
Fangjun Jiang
2011년 12월 8일
Okay, now I may be able to make the answer complete.
In workspace window, you need to double click the variable, 'A' in the above example. You'll then see a 10x10 grid like an Excel spread sheet. Then you can select a particular column and press the GUI plot button.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!