Row vector and corresponding column vector for each row
显示 更早的评论
I want to create a single row vector with each element of the row array being a column vector and I want to access a certain element of any row number and the column which would be user-defined.
4 个评论
KL
2017-12-5
... a single row vector with each element of the row array being a column vector...
What do you mean? A matrix? A row-vector like cell-array with column vectors?
...I want to access a certain element of any row number and the column...
Don't you want to create a row vector? row vector is supposed to have only one row!
Stephen23
2017-12-5
"...I want to access a certain element of any row number and the column which would be user-defined"
It sounds like a matrix would satisfy those requirements.
kd p
2017-12-5
kd p
2017-12-5
回答(1 个)
Jos (10584)
2017-12-5
Something like this?
% two cell arrays (being column vectors) of strings
c1 = {'hello', 'friend'}
c2 = {'my' ; 'name' ; 'is' ; 'joe'}
% create cell row vector holding these cell array of strings
r = {c1 c2}
3 个评论
kd p
2017-12-5
kd p
2017-12-5
Jos (10584)
2017-12-5
编辑:Jos (10584)
2017-12-5
Sorry, you've lost me. I suggest you read the Getting Started section of the manual and learn about cell arrays and structs. These might be what you are looking for.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!