Line property error with time series plot

4 Ansichten (letzte 30 Tage)
John R
John R am 1 Feb. 2019
Kommentiert: Luna am 1 Feb. 2019
I am trying to produce a simple, time series plot of wind speeds for a specified date and time range. I am importing data from a csv file, but running into a error that says 'There is no A property on the line class'. It looks like it is assigning 'A' to the wind variable, but I'm not sure why. Here is my code:
Wind='FloNOAANBDCSep18WindSpd';
wind=Wind(:,7);
t1=datetime(2018,8,31,23,10,0);
t2=datetime(2018,9,30,23,0,0);
time=t1:minutes(10):t2;
plot(time,wind,'r')
title('Wind Speed at CMAN CLKN7')
ylabel('m/s')
legend('NDBC')
Thanks for suggestions.

Akzeptierte Antwort

Luna
Luna am 1 Feb. 2019
Bearbeitet: Luna am 1 Feb. 2019
Hi John,
The below line is only gives the char array of a file name. You are not actually importing your data.
Wind='FloNOAANBDCSep18WindSpd';
You should read your csv and get it to your workspace first. You can use below functions:
[Wind,txt,raw] = xlsread('FloNOAANBDCSep18WindSpd.csv'); % for numeric(Wind) or raw data
%or
Wind=readtable('FloNOAANBDCSep18WindSpd.csv'); % for table
%or
Wind = csvread('FloNOAANBDCSep18WindSpd.csv') % For numeric
% You can also use full file path all of these three functions:
'C:\users\documents\FloNOAANBDCSep18WindSpd.csv'
  2 Kommentare
John R
John R am 1 Feb. 2019
Great, thanks for the help!
Luna
Luna am 1 Feb. 2019
Your welcome :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by