Error- Not enough input arguments when tried to plot data extracted from a table
이전 댓글 표시
Hi,
I tried importing data from excel into a variable of datatype table
from that I extracted two different columns using bewlo commands
Freq= Data{2:121,3}
ExpectedPow= Data{ 2:121,6}
when I tried to plot Freq v/s Expected Pow its throwing an error 'Not enough input arguments'
In the workspace I can see it took Expected pow as 120*1 categorical and Freq as 120*1 string.
Can you please help on how to plot this?
댓글 수: 4
madhan ravi
2018년 12월 27일
Mind uploading the required data ?
Walter Roberson
2018년 12월 27일
please show the plot call.
N/A
2018년 12월 27일
답변 (1개)
madhan ravi
2018년 12월 27일
Just a guess:
Freq = str2double(Data{2:121,3});
ExpectedPow = str2double(Data{2:121,6});
plot(Freq,ExpectedPow)
댓글 수: 6
N/A
2018년 12월 27일
madhan ravi
2018년 12월 27일
편집: madhan ravi
2018년 12월 27일
xlim([18550 19050])
ylim([20 30])
N/A
2018년 12월 27일
madhan ravi
2018년 12월 27일
upload your data
madhan ravi
2018년 12월 27일
Attached the data file
madhan ravi
2018년 12월 27일
편집: madhan ravi
2018년 12월 27일
Here you go!
T=readtable('data.xlsx');
a=T{:,end};
Freq=T{:,3};
ExpectedPower = str2double(strrep(a, '''', ''));
plot(Freq,ExpectedPower)
xlim([18550 19050]) % alter the limits according to your needs
ylim([20 30])
Note: Matlab modifies the variable names a bit in order to make it a valid name.
Not a surpise that you will get a graph with horizontal line because the y values are constant (only 2 points are there in the file).
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!