Help using sprintf to create a title using user inputs
이전 댓글 표시
Hi all,
I've got my main code working now but I'm trying to add a few user inputs (I've never done this before). I'm falling over when trying to take the user inputs and add them together to make a title for all of my graphs further in the program.
I'm using
suptitle(TIT)
to create the title later on. The bit of code I'm struggling with in
% File Sub Function to inport data
[FileName,PathName] = uigetfile('*.txt','Select the Locator file to load');
prompt={'Enter Graph Title (e.g. Mida Arm Stiffness):',...
'Enter M/C Number (e.g.668-127):',...
'Enter your name (Format - Surname.First Initial):'};
% Create all text fields with the questions specified by variable prompt
title='User Options Dialog';
% The main title of your input dialog interface.
answer = inputdlg(prompt,title);
SuperTitle = answer{1};
MC_Number = answer{2};
Operator_Name = answer{3};
[Position,Adjust] = importfile3...
(FileName,1,2250);
% Create the title for all graphs
TIT = sprintf('%g',SuperTitle,'%g',MC_Number,'%g', Operator_Name);
Is
*% Create the title for all graphs
TIT = sprintf('%g',SuperTitle,'%g',MC_Number,'%g', Operator_Name);*
Anyone know what I'm doing wrong? After this line TIT = a 1 x 48 character Not a title.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!