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 中查找有关 Large Files and Big Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!