I want to create string of characters from variable name And use it as a name of an excel file. It's easy to create a single string but I want to write a function that generalizes this situation. For my part: I have a signal that I have to cut into several windows, for each window I have to calculate values (5 values) And in the end I have to store: for each window of a signal, its parameters in a file
Example:
Signal S.
I cut signal S into 3 windows; I need to create 3 excel files:
S_1S_2S_3
Proposed solution :
function str = display (signal, i) formatSpec = "% s_% d"; str = sprintf (formatSpec, signal, i)endfunction FeatureExtract (signal, numOfwindows)for i = 1: numOfwindows feature =parameters (signal); str = display (signal, i)endend
Main program:
FeatureExtract (mysignal)
I want this result: 3 excel files for 3 windows:
Mysignal_1Mysignal_2Mysignal_3
Best Answer