store a vector as an (i,j) entry of a matrix in matlab

前端 未结 1 506
梦谈多话
梦谈多话 2021-01-25 06:36

This is a simplified version of the project I am doing. I can get around this using other methods. I was just wondering, is it possible to do this in matlab ? I want to store a

相关标签:
1条回答
  • 2021-01-25 07:25

    You can use 3-d matrix instead of 2-d matrix if you already know the length of vector.

    a = zeros (2,2,2) ;
    a(1,1,:) = [100, 100] ; 
    

    or

    a =  [];
    a (1,1,:) = [100,100];
    

    In above example, you have to take care of indexing by yourself and matrix a can be in arbitrary dimensions.

    0 讨论(0)
提交回复
热议问题