i have an error when i draw a polar The error is
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Dyuman Joshi
am 19 Mai 2023
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
am 19 Mai 2023
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.
Antworten (1)
Dyuman Joshi
am 19 Mai 2023
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 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!