필터 지우기
필터 지우기

i want to create an excel sheet for A=14/(cos(b))^3,where b varies from 8 to 25(i.e 8,9 ....,25). How to write a programme ?

조회 수: 1 (최근 30일)
i want to create an excel sheet for A=14/(cos(b))^3,where b varies from 8 to 25(i.e 8,9 ....,25). How to write a programme ?
  댓글 수: 2
Guillaume
Guillaume 2016년 9월 11일
while it's not hard to do in matlab, it's trivial to do in excel. Since you want the result in excel, why don't you do it directly there?
Rahil Sonkusare
Rahil Sonkusare 2016년 9월 11일
i am in learning phase trying to eplore my matlab knowledge , just out of curiosity i am asking question and will be glad to accept answer.

댓글을 달려면 로그인하십시오.

채택된 답변

taher azim
taher azim 2016년 9월 11일
this will be ur program
function surfer()
m=zeros(18,1)
for b=8:1:25
A=14/(cos(b))^3;
m((b-8)+1,1)=[a];
end
%create a blank excelsheet in ur matlab directory with a proper filename%
filename = 'filename.xlsx';
xlswrite(filename,m);
end
%to design ur output in excel refer to matlab help section and type xlswrite.%

추가 답변 (1개)

Guillaume
Guillaume 2016년 9월 11일
편집: Guillaume 2016년 9월 11일
Well, if you really want to do it in matlab, the efficient way of doing it is:
b = 8:25;
A = 14/cos(b).^3;
xlswrite('full path to your file.xlsx', [b; A]'); %tranposed b and A so they're written by column
Not using slow loops.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by