MATLAB Answers

0

concatenate text and variables in a uitable

Pedro Guevara さんによって質問されました 2019 年 6 月 14 日
最新アクティビティ Pedro Guevara さんによって コメントされました 2019 年 6 月 14 日
Good afternoon. I have the following problem I have a matrix (XonT) that is variable in size and "double", and I am trying to add a row of type "char" to the end of the XonT matrix, but I can not understand it. , and I guess it's due to the Incopatibility between types. Is there any way to achieve this? I leave the following code in which I am working. Thank you.
for f=1:NP
Modos = (TTT(1:NP,1:NP)*(10^6)*Cant_port) - ((sol_frec(f,1))^2)*Matriz_masa ;
EO1= Modos(2:NP, 1);
EOO= Modos(2:NP, 2:NP);
Xon = inv(EOO)*(-1)*(EO1);
Xon =[1;Xon];
XonT (:, f) = Xon;
XonT (NP+1, f)= ['Mod',num2str(f)] ; % This is the line of code that the row should be for me !!!!
end

  2 件のコメント

dpb
2019 年 6 月 14 日
Forget the nonworking code; show example of the data structures you have and what you're trying to achieve.
We don't have any of the variables in your code snippet to look at so doesn't help much...
Pedro Guevara 2019 年 6 月 14 日
OK. I explain. the vector "Xon" is a vector of "NP" rows and that is filled in each cycle (from 1 to NP), in each cycle the vector "Xon" is added to the matrix "XonT" in the form of a column, where the "XonT" matrix should be of NPxNP size. What I want is for the matrix "XonT" to have a row of more (being of (NP + 1xNP) in which I have to add concatenated characters, for example: In the row "NP + 1" I want concatenated characters to be added with the form ["'Mod', num2str (f)]" So with all the elements of row NP + 1.
Example:
  • for the first cycle
1.png
  • for the second cycle
2.png
  • And so on until the NP = 3 cycle
Thanks for your help

サインイン to comment.

製品


リリース

R2017b

0 件の回答


Translated by