How do I import the data correctly for it to accept it?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
This what I have so far but it keeps giving me a error.
clear;
clc;
close all
load AVG_Temp.txt
% 1st line is data of Philly
Philly=AVG_Temp(1,:);
% 2nd line is data of Raleigh
Raleigh=AVG_Temp(2,:);
% 3rd line is data of Fresno
Fresno=AVG_Temp(3,:);
% plot-1
subplot(1,3,1)
plot(1:length(Philly),Philly,'--d')
xlabel('Month')
ylabel('Avg. Temperature')
title('Philly')
axis([1 12 30 105])
% plot-2
subplot(1,3,2)
plot(1:length(Raleigh),Raleigh,'--d')
xlabel('Month')
ylabel('Avg. Temperature')
title('Raleigh')
axis([1 12 30 105])
% plot-3
subplot(1,3,3)
plot(1:length(Fresno),Fresno,'--d')
xlabel('Month')
ylabel('Avg. Temperature')
title('Fresno')
axis([1 12 30 105])
Error using load
Unknown text on line number 1 of ASCII file AVG_Temp.txt
"Philly".
Error in ME02_Baluch_Assign9 (line 50)
load AVG_Temp.txt
2 Commenti
Rik
il 17 Nov 2020
The key search term is already in your question title. Did you google how to import data from a text file? Can you attach your text file (you can edit your question and use the paperclip icon to attach it).
Did you use the debugger to step through your code line by line? What happens when you reach the line with load?
Risposte (1)
Vedere anche
Categorie
Scopri di più su Other Formats in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!