V_rng = [0:0.001:27.7778];
%**********************************************
%Vehicle Aerodynamic drag calculation and plot
%**********************************************
Cd = 0.0145; % Aerodynamic Drag Coefficient
row = 1.1; % Density of air
A = 0.5; %projected Vehicle area
F_drag = double.empty;
index = 1;
for i = V_rng
F = 0.5* row * Cd * A * (i^2);
F_drag(index) = F;
index = index + 1;
end
subplot (2,2,1)
title('Aerodynamic Drag Vs Vehicle Velocity')
plot(V_rng,F_drag)
xlabel('Vehicle Velocity[m/s]')
ylabel('Vehicle Aerodynamic Drag Force [N]')
%writing values to excel file
xlswrite('forceValues', F_drag)
xlswrite('VelocityValues', V_rng)
The error im getting: Error using xlswrite (line 224)
The specified data range is invalid or too large to write to the specified file format. Try writing to an XLSX file and use Excel
A1 notation for the range argument, for example, ‘A1:D4’.
Error in Resistive_Forces_calculations (line 27)
xlswrite('forceValues', F_drag)

답변 (1개)

Shawn Duenas
Shawn Duenas 2019년 2월 6일
편집: Shawn Duenas 2019년 2월 6일

0 개 추천

To print to different worksheets in the same spreadsheett:
xlswrite(myFile, F_drag, 'forceValues')
xlswrite(myFile, V_rng, 'VelocityValues')
to print to new spreadsheets, add '.xls' to end of file name.
xlswrite('forceValues.xlsx', F_drag)
xlswrite('VelocityValues.xlsx', V_rng)

카테고리

제품

릴리스

R2018b

질문:

2019년 2월 6일

편집:

2019년 2월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by