Viable format that would satisfy the requirements for transfering from Matlab to Excel.

1 view (last 30 days)
I am dealing with a 4x4x4 matrix. It is easier to sent the results to Excel. I have the format as a "double" but Matlab does not like that when sending to Excel. Is there a viable format that would satisfy the requirements for transfering from Matlab to Excel.
Program:
exl = actxserver('excel.application');
exlWkbk = exl.Workbooks;
exlFile = exlWkbk.Open(['C:\MATLAB7\work\Analysis_Excel.xlsm']);
exlSheet1 = exlFile.Sheets.Item('Sheet1');
exl.visible = true;
for i=1:4
for j=1:4
for k=1:4
Affinity(i,j,k)=double(subs(Affinity0(i,j,k),{r,h},{7000,0.7071}))
end
end
end
exlSheet1.Range(['C' num2str(3)]).value=Affinity(1,1,1)
exlSheet1.Range(['D' num2str(3)]).value=Affinity(1,1,2)
...
Error code:
Warning: ActiveX - invalid argument type or value.
> In Analysis_Excel>Evaluate at 82
exlSheet1 =
Interface.Microsoft_Excel_12.0_Object_Library._Worksheet
What type or value do they mean? Format other than double?

Answers (0)

Community Treasure Hunt

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

Start Hunting!