adding only to the y value in matrix
古いコメントを表示
I need to add a constant only to the y value of all inputs in a matrix.
The task is to make it look like its lifted upwards on a graph.
3 件のコメント
Geoff Hayes
2021 年 2 月 11 日
Paul - which row or column of the matrix corresponds to the y value? Whichever that might be, just add the constant to it.
constantValue = 42;
matrix = randi(255,10,2);
matrix(:,2) = matrix(:,2) + constantValue; % add the constant value to the second column
Paul Jackson
2021 年 2 月 11 日
Geoff Hayes
2021 年 2 月 11 日
Or just add a constant to the column (or row) of the matrix that has the y data. You may need to show us what your current matrix looks like (how is it constructed, where are the x and y values), etc.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Linear Algebra についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


