Upload data from file and store into variable

조회 수: 1 (최근 30일)
Kartavya
Kartavya 2014년 4월 18일
편집: per isakson 2014년 4월 20일
HI, So far I have the code that takes the coordinates from the airfoil and stores all of them in a variable to be later used in the code. However I need to know how many points are being stored in the variables.
This is the input file
1.0000000 0.0000000
0.9500000 -.0074400
0.9000000 -.0130900
0.8000000 -.0204800
0.7000000 -.0236700
0.6000000 -.0235600
0.5000000 -.0216500
0.4000000 -.0191400
0.3000000 -.0183300
0.2000000 -.0195200
0.1500000 -.0207600
0.1000000 -.0220100
0.0750000 -.0222300
0.0500000 -.0218500
0.0250000 -.0195800
0.0125000 -.0164400
0.0000000 0.0000000
0.0125000 0.0204600
0.0250000 0.0304200
0.0500000 0.0456400
0.0750000 0.0576700
0.1000000 0.0670900
0.1500000 0.0822400
0.2000000 0.0921800
0.3000000 0.1018700
0.4000000 0.0993600
0.5000000 0.0897500
0.6000000 0.0743400
0.7000000 0.0567300
0.8000000 0.0378200
0.9000000 0.0197100
0.9500000 0.0116600
1.0000000 0.0000000
This is the code I'm using to get data from the file:
function [x,y]=AirfoilC
load Airfoil.dat; % read data into the my_xy matrix
x = Airfoil(:,1); % copy first column of my_xy into x
y = Airfoil(:,2);
So I need another variable that states how many points are being stored in x and output that for later usage.

답변 (1개)

per isakson
per isakson 2014년 4월 18일
편집: per isakson 2014년 4월 20일
Try
number_of_rows_of_my_xy = size( my_xy, 1 );
and
doc size

카테고리

Help CenterFile Exchange에서 Airfoil tools에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by