Error in loading all the files in folder into code to run it on all files

1 回表示 (過去 30 日間)
Nidhi Chakravarthy
Nidhi Chakravarthy 2021 年 5 月 17 日
コメント済み: Walter Roberson 2021 年 5 月 18 日
Hello,
I am using below code and I am getting an error saying:
>> extract_6_25_degree
ans =
'l2.5_d7.6_flat_2DScat_lim25.jpg'
Brace indexing is not supported for variables of this type.
Error in extract_6_25_degree (line 14)
imagefilepath=strcat('../../images/images_','/Users/apple/Documents/MSCPROJ/database/','/',data{i},'_','/Users/apple/Documents/MSCPROJ/database/','.png');
>>
Code:
AngularPlot('/Users/apple/Documents/MSCPROJ/database/l2.5_d7.6_flat.h5','abg',[0 10 20],'minangle',6,'maxangle',25)
imagefilepath=strcat('../../images/images_','/Users/apple/Documents/MSCPROJ/database/','/',data{i},'_','/Users/apple/Documents/MSCPROJ/database/','.png');
saveas(gcf,'/Users/apple/Documents/MSCPROJ/savedimages')
%You'll need to select the appropriate intensity bins from the .h5 file. You can do this from data.coordinates.elevation.
% Below is some sample Matlab code:
data=h5ToStruct('/Users/apple/Documents/MSCPROJ/database/l2.5_d7.6_flat.h5'); % Load hdf5 into Matlab
nOrient = 1; % select the first orientation
mask = (data.coordinates.elevation>=6) .* (data.coordinates.elevation<=25); % create mask of selected region
sid3Intensity = data.intensity(mask==1, nOrient); % get the intensity from the masked region
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 5 月 18 日
imagefilepath=strcat('../../images/images_','/Users/apple/Documents/MSCPROJ/database/','/',data{i},'_','/Users/apple/Documents/MSCPROJ/database/','.png');
It is quite unlikely that that would be correct -- not unless it was being used by some specialized function that was splitting the path at underscores.
But you do not show the variable being used, so it is not clear why you are doing the assignment at all.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by