First column matrix into ones
4 ビュー (過去 30 日間)
古いコメントを表示
Hello! How to extract the first coulmn of the matrix and make it ones?
For exmaple:
X = [1 4; 2 2; 3 6];
y = ones(X(:,1));
but it seems not work.
Thanks advanced for your help!
2 件のコメント
Walter Roberson
2022 年 3 月 5 日
Okay, X(:,1) would be [1;2;3] .
Now what do you mean by "make it ones" ? Are you asking for a vector of ones with the same number of entries as there are rows in the table? Are you asking that afterwards X would be
1 4
1 2
1 6
??
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!