Help using sprintf to create a title using user inputs
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!