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!