フィルターのクリア

How to replace all row vectors except 1st according to the difference?

3 ビュー (過去 30 日間)
Sadiq Akbar
Sadiq Akbar 2023 年 1 月 16 日
コメント済み: Matt J 2023 年 1 月 16 日
I have a matrix named as 'two' of size 100 x 4. I have also a singe row vector u=[-55 55 65 -65]; Let we find the error between 1st row of matrix two and u i.e.,
Error=two(1,:)-u;
Now I want to find 99 more Error elements from this single Error which are logrithmically decreasing. Then I want to replace all 99 row vectors of matrix two according to these 99 Errors. The matrix 'two' is in the mat file 4sn0dB.mat which is given in the attachment.
  2 件のコメント
Kevin Holly
Kevin Holly 2023 年 1 月 16 日
"Then I want to replace all 99 row vectors of matrix two according to these 99 Errors"
How did you want to do this? Do you want to replace row with large error above a specific threshold? What will you replace the row with?
Sadiq Akbar
Sadiq Akbar 2023 年 1 月 16 日
編集済み: Sadiq Akbar 2023 年 1 月 16 日
Thanks a lot dear Kevin Holly for your kind response. When I find the 1st Error i.e.,
Error=two(1,:)-u;
Then I want to extend this one Error into 99 such values which are logritmically decreasing values of this Error. Say for example the above 1st Error is Error=[0.001 -0.021 0.0021 0.015]. Now I want o find 99 more Errors from this single Error but those all should be logrithmically decreasing values of this. Then add the corresponding Error2 to u to get two(2,:). Likewise add Error3 to u to get two(3,:) and so on. Likewise for all 99 Errors, add them to u to get all 99 rows of updated two matrix.

サインインしてコメントする。

採用された回答

Matt J
Matt J 2023 年 1 月 16 日
編集済み: Matt J 2023 年 1 月 16 日
two = (two(1,:)-u).*logspace(0,-5,100)' +u;
  2 件のコメント
Sadiq Akbar
Sadiq Akbar 2023 年 1 月 16 日
Thanks a lot dear Matt J for your kind response. I did like below using your code:
clear all; clc
load 4sn0dB
two2 = (two(1,:)-u).*logspace(0,-5,10)' +u;
Both=[two two2]
But it gives me the following error:
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
Error in ReplacingMatrix_twoRows (line 7)
Both=[two two2]
Matt J
Matt J 2023 年 1 月 16 日
Should be logspace(0,-5,100)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by