I have been trying to write a title for a plot using a table that I have for the variables (see the pictures), and I am aiming for the title to look like this: "Variable name" + " unit " + 10^"decimal point".
The struggle now is that I could not find out how to compare both the variable name colums between the two tables and I am also not sure how to write them in the title through a loop everytime. I ve had some trials but no success
for k = 1:numel(U) X = T.Variable==U(k); Var2=Variableunits.Variable;%the table that contains the units and the decimal factor that should be used.
Num2= size(Var2,1); for j= 1:Num2 if strcmpi(Var2{i},U(k)) == 0 % in case the the a variable from the arrray U and from the column Var2 are identical, Im not sure if it is right.
title(Var2{i},Variableunits.unit,Variableunits.Faktor); % write the variable, its unit and factor (I know it is not written right.)
end endend
Thanks a lot in advance in case someone can help!
Best Answer