Borrar filtros
Borrar filtros

How to save column values as Mat file in for Loop

2 visualizaciones (últimos 30 días)
Med Future
Med Future el 7 de Feb. de 2022
Comentada: Benjamin Thompson el 10 de Feb. de 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

Respuesta aceptada

Benjamin Thompson
Benjamin Thompson el 8 de Feb. de 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 comentario
Benjamin Thompson
Benjamin Thompson el 10 de Feb. de 2022
Has your question been answered? If so, please accept the answer.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by