How to Import compex numbers from excel to matlab?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi everyone!
My problem is: I have vecto x contains double numbers, x = (1 2 3 4) and a vecto y contains complex numbers, y = (1+2i 2+3i 4+5i 5+6i)
I create a matrix z = [x;y],
And, then, i want to create a excel file (see code below)
I have a file excel that has two rows:
1 2 3 4
1+2i 2+3i 4+5i 5+6i
And, now, i want to get again data from excel file, but i can't.
i only get first row of the excel file in aaaa variable.
Of course, i can use:
[aaaa,text] = xlsread(aaa), and, then convert strings in text to numbers. But, it is not general.
Do you have any best the way that is more general, i mean use directly "aaaa"
My code:
x = [1 2 3 4]
y = [1+2i 2+3i 4+5i 5+6i]
z = [x;y]
% Create a excel file
zz = num2cell(z)
zzz = cellfun(@num2str,zz,'UniformOutput',false)
xlswrite('zzz.xlsx',zzz)
% Load data from file excel to matlab
aaa = uigetfile('*.xlsx')
aaaa = xlsread(aaa)
Thank you so much!
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!