Names on x-axis in the excel file
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I am having trouble in plotting, I want to plot the graph where x-axis are names and y-axis numbers but I am getting the error below. what is solution for that.
Code:
close all; clear all; clc;
file = ["C:\Users\Alphagamma\alphagamma.xlsx];
for i = 1:numel(file)
a=readtable(file(i));
names = a{:,3}
values = a{:,5}
end
figure()
plot (names,values)
Error:
>> figure()
plot (names,values)
Error using plot
Invalid data argument.
댓글 수: 2
Ankit
2022년 9월 13일
You can only plot numeric data. But x label you can change with the help of xTickLabels
set(gca, 'xTickLabels', XlabelStr);
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Bar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!