Cant figure out why my program isnt working
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
% ENGR 1120 Sec.10
% 2/7/12
% This program
clear,clc
filename=input('Enter file name in quotes');
data=load(filename);
dist_trav=data(:,1); %ft
direction=data(:,2);
%
%
% Convert clocking to angles
angle = rem((60 - (direction - 1) * 30) + 360, 360) %degrees
%
% Plot graph of results
plot(dist_trav,direction)
title('Homework2')
xlabel('Distance to travel')
ylabel('Direction to travel'),grid
The file that is the input contains two columns of number data both 1x5
6 Kommentare
Walter Roberson
am 13 Feb. 2012
What error do you get, or what difference do you see between what you expect and what you get?
Jan
am 13 Feb. 2012
Without knowing any details of the problem, a meaningful answer is impossible.
Cory
am 13 Feb. 2012
Cory
am 13 Feb. 2012
Jan
am 13 Feb. 2012
@Cory: Please be so kind and post a *complete copy* of the error message. We need 1. the line, which causes the error, 2. the error message itself, 3. size/type/contents of the used variables, if they matter.
The code you've posted does not contain the term "hmwrk2" and it is not clear which command causes the index overflow.
Cory
am 13 Feb. 2012
Antworten (2)
Walter Roberson
am 13 Feb. 2012
0 Stimmen
You are trying to run the script file by naming the input file on the command line. Don't do that. Just run the script file and let it prompt you for the input file.
1 Kommentar
Cory
am 13 Feb. 2012
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!