Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
need help with program wrote script but its not totally right
조회 수: 4 (최근 30일)
이전 댓글 표시
The data files contain in the first column a distance to travel and in the second column a direction. heading the direction headings are given as referenced to a clock face.
The pattern begins at the origin of a Cartesian coordinate system with the person facing 12 o’clock, see the figure below. The figure shows an example of the first step in the pattern being a distance of 1.5 feet in the direction of 7 o’clock. All direction headings are given in terms of this clock orientation.
The distance values given are in feet.
Write a script file that will allow the user to input from the
keyboard the filename of the file that they wish to analyze. Load
only that data file and plot the resulting pattern.
Defined to occur at the coordinate location corresponding to (average x, average y). When plotting the resulting pattern on the Cartesian coordinate system, set the axes limits appropriately.
file_1 = x column(distance) 1.2,1.6,1.2,1.6,1.2
y column(clock face) 9,12,3,12,9
% This program determines patterns by (x,y) coordinates that are
% calculated with given data
clear,clc
filename=input('Enter file name in quotes');
data=load(filename);
data(:,2)=clock;
angle=rem((60 - (clock - 1) * 30) + 360, 360);
angle=theta;
data(:,1)=hypotenuse;
h=hypotenuse;
x=cos(theta)*h;
y=sin(theta)*h;
disp('plot(x,y)')
disp('xlabel')
disp('ylabel')
disp('title')
disp('grid')
fprintf('%3.2f %2.1e %9.13f\n',[plot(x,y)])
Im new to matlab so this
댓글 수: 3
Walter Roberson
2012년 2월 14일
You need to show us _exactly_ what an input file looks like. For example you cannot use "load" if the file has commas.
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!