Effacer les filtres
Effacer les filtres

Xlsread and xlswrite; easy small help

2 vues (au cours des 30 derniers jours)
Jose
Jose le 25 Juil 2012
Thank you for your interest. My question is: I have a file written on Excel, and I need to write the answers from my code onto the sheet. I can view them in Matlab but can't seem to export them to Excel.
Here is my code:
%%Test
%
clear all
clc
aux=1
for(grados=0:1:360)
radianes=grados*pi/180;
f1(aux)=sin(radianes);
ejex(aux)=grados;
aux=aux+1;
end
f1
OK, well, I see the answers on matlab, but I want to take that info descending vertical order to be shown in Excel please help me with my xlswrite

Réponse acceptée

Conrad
Conrad le 26 Juil 2012
You could try this:
excelFileName = 'Test.xls';
f1 = sin((0:360)*pi/180)';
success = xlswrite(excelFileName,p);
Note that you do not need a for loop to calculate f1 but you can pass in a whole array into the "sin" function.
Conrad
  1 commentaire
Jose
Jose le 26 Juil 2012
Modifié(e) : Jose le 26 Juil 2012
I figured it out thanks alot

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by