Filter löschen
Filter löschen

How to save column values as Mat file in for Loop

2 Ansichten (letzte 30 Tage)
Med Future
Med Future am 7 Feb. 2022
Hi all, i hope you are doing well
i have the code, the frameread has shape 1024x9999,
i want to save the 1024 value of every column in seprate mat file in MATLAB how can i do that
dataDirectory='C:\Users\DELL\Documents\MATLAB\Examples\R2021b\deeplearning_shared\ModulationClassification'
fileNameRoot = "frame";
for p=1:length(frameread)
% Remove transients from the beginning, trim to size, and normalize
frameread = helperModClassFrameGenerator(S, spf, spf, transDelay, sps);
% Save data file
fileName = fullfile(dataDirectory,...
sprintf("%s%s%03d",fileNameRoot,'MOD',p));
save(fileName,"frame")
end

Akzeptierte Antwort

Benjamin Thompson
Benjamin Thompson am 8 Feb. 2022
Some possible changes are in bold text below. Hard to be sure without all the data and code.
dataDirectory='C:\Users\DELL\Documents\MATLAB\Examples\R2021b\deeplearning_shared\ModulationClassification'
fileNameRoot = "frame";
frameread = helperModClassFrameGenerator(S, spf, spf, transDelay, sps);
for p=1:size(frameread,2)
% Remove transients from the beginning, trim to size, and normalize
% Save data file
fileName = fullfile(dataDirectory,...
sprintf("%s%s%04d",fileNameRoot,'MOD',p));
save fileName frameread(:,p)
end
  1 Kommentar
Benjamin Thompson
Benjamin Thompson am 10 Feb. 2022
Has your question been answered? If so, please accept the answer.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by