i have an error when i draw a polar The error is
1 次查看(过去 30 天)
显示 更早的评论
clc
clear all
close all
path = 'H:\radition';
Date= importdata([path '\radd.csv']);
dB = Date(1:360,3);
% pol_1 = 10*log10(Data(1:121,3)./max(Data(1:121,3)));
Theta = Data(1:361,1)*pi/180;
dB = dB-min(dB);
polarplot (Theta,(dB/50))
hold on
3 个评论
Dyuman Joshi
2023-5-19
Date() has 360 rows, and you are trying to access 361st and 362nd row, which is not possible.
Also, the code in the problem uses 1:360 and the code in the above comment uses 1:362, which is weird.
Adam Danz
2023-5-19
I believe line 8 is db = Date(1:360,3); in which case Date appears to have only 1 row according to the error message.
回答(1 个)
Dyuman Joshi
2023-5-19
importdata loads the data into a structure array for the given input (i.e. spreadsheet) and does not include the first column in the output (rather it classifies it as rowheaders)
And use the indices within the range of the size of "Date".
%Struct array
out1 = importdata('radd.csv') %size of data is 360x7, it should be 360x8 as below
%Numeric array
out2 = readmatrix('radd.csv')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!