MATLAB: I want to print the dot number that contains the text character. str2mat clearclcNN = str2mat('s23;s24');for i = 1:2 name{i}= sprintf('%d. Point', NN(i))end I tried something like that but I could not do it. Best Answer NN_split = strsplit(NN, ';');for i = 1 : 2 name{i} = sprintf('%s. Point', NN_split{i});endMind you, I would not have initialized NN that way in the first place unless there was good reason to:NN = {'s23', 's24'};for i = 1 : 2 name{i} = sprintf('%s. Point', NN{i]);endor more simplyNN = {'s23', 's24'};name = strcat(NN, '. Point');with no loop. Related SolutionsMATLAB: I can’t request user sting input Since the names may be different lengths name needs to be a cell array. Try name{i} instead of name(i). MATLAB: How to obtain new coordinates of elements in strings array Call ismember with two outputs[tf,loc]=ismember(sprintf('e%d_u%d',i,m),txt(:))The output "loc" gives the location within txt(:). Related QuestionHow to plot a graph from a code that is is using a function and looping featureI am having a problem in the dialog box.Doesn’t this simple search program workWhy doesn’t limitation this work
Best Answer