how can i convert my image and excel file to get a working 2D VMD output?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello, I am seeking guidance. I am kind of new to matlab and i want to see what the 2D VMD function/script does to my images/xlsx file for some interesting analysis. Can you please help me to get it to wrok? I tried the attached script by converting it from a xlsx file to a mat file then loading it into the script but it is NOT working and I can't get it to run successfully. PLEASE HELP and explain slowly thank you!!
Here's the code i used to convert from xlsx to mat file:
data = xlsread('DATASSHEET.xlsx');
save('DATASHEET.mat', 'data');
texture = load('DATASHEET.mat');
f = texture.data;
I also attached an excel file that is nearly identical to the numerical data that I will import and upload (ignore the letters). Please help me to figure this out!! I can not figure why its not working for my data after converting it to mat file. I just want to see what it outputs using the VMD_2D and/or VMD_2D_test.
I also have a jpg image that (attached) that I want to import into this code too (spoiler) can't get that one to work either. thanks for your suggestions! Please help!!
답변 (1개)
Alexander
2023년 3월 8일
I don't want to care about VMD_2D.m, that's your part. But xlsread works fine, see Test.m:
data = xlsread(['DATAMATRIX.xlsx']);
save('DATAMATRIX.mat', 'data');
texture = load('DATAMATRIX.mat');
f = texture.data;
format long
disp(f(1:10,1:4))
format short
>> Test
1.0e+03 *
0.001000000000000 1.161000000000000 0.652603000000000 0.000560000000000
0.002000000000000 1.162000000000000 0.667105000000000 0.000572000000000
0.003000000000000 0.733000000000000 0.487580000000000 0.000663000000000
0.004000000000000 0.526000000000000 0.365467000000000 0.000692000000000
0.005000000000000 0.502000000000000 0.332086000000000 0.000658000000000
0.006000000000000 0.352000000000000 0.253503000000000 0.000716000000000
0.007000000000000 0.447000000000000 0.315372000000000 0.000702000000000
0.008000000000000 0.432000000000000 0.351157000000000 0.000811000000000
0.009000000000000 0.447000000000000 0.388090000000000 0.000867000000000
0.010000000000000 0.477000000000000 0.378214000000000 0.000791000000000
If you need the information of the first two columns also, use readtable or importdata.
댓글 수: 5
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!