create string of characters from variable name matlab
이전 댓글 표시
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_1
S_2
S_3
Proposed solution :
function str = display (signal, i)
formatSpec = "% s_% d";
str = sprintf (formatSpec, signal, i)
end
function FeatureExtract (signal, numOfwindows)
for i = 1: numOfwindows
feature =parameters (signal);
str = display (signal, i)
end
end
Main program:
FeatureExtract (mysignal)
I want this result: 3 excel files for 3 windows:
Mysignal_1
Mysignal_2
Mysignal_3
댓글 수: 2
Stephen23
2018년 4월 25일
@Ouerdia Tahar: you did not ask us anything. What is your question?
Ouerdia Tahar
2018년 4월 25일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!