[x,index]=a(1,:)怎么修改。

[x,index]=a(1,:)怎么修改 a = [3 9 4 5 2 7; 6 8 3 3 1 4;2,3,4,5,6,7]
我想要实现 x=[3 9 4 5 2 7]
index=[1,2,3,4,5,6]
请问相关的代码应该是什么样的?

 Respuesta aceptada

stfwfpn
stfwfpn el 22 de Mayo de 2023

0 votos

引用矩阵对变量赋值时只能
x = a( 1, : )
右侧为矩阵时不能用 = 给多个变量赋值
另外你这个 index 也看不出跟 a 有什么关系

Más respuestas (0)

Categorías

Más información sobre 矩阵和数组 en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 22 de Mayo de 2023

Respondida:

el 22 de Mayo de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!