From User Input to File Name
Ältere Kommentare anzeigen
Hi all,
I am a bit stuck with my script. What I am trying to achieve is to request an input from the user (a number). Then make this input part of the file name that I am trying to export.
This is the code I have written so far, but unfortunately, it does not work.
Where am i going wrong?
clc
clear all
close all
A=2000
prompt = {'Project Number:'};
dlgtitle = 'Input';
dims = [1 50];
definput = {' '};
answer = inputdlg(prompt,dlgtitle,dims,definput)
writematrix(A,'num2str(answer)+TEST.csv')
Many thanks
1 Kommentar
KSSV
am 17 Okt. 2022
writematrix(A,'num2str(answer)+TEST.csv')
What you are expecting to do from the above line?
Akzeptierte Antwort
Weitere Antworten (1)
Enrico Gambini
am 17 Okt. 2022
Try to use the function "strcat" and "string"
str=string(answer);
writematrix(A,strcat(str,'+TEST.csv'))
1 Kommentar
MATLAB_Soldier
am 18 Okt. 2022
Kategorien
Mehr zu Calendar finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!