Error using horzcat dimensions are not consistent
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hi the file is attached. Kindly check this and guid me for removing the error.
採用された回答
Guillaume
2020 年 1 月 22 日
Why are x and t symbolic? This just slows down everything for no gain. I'm not even sure that your code would work (but I don't have the symbolic toolbox so can't check).
Why can't you find the problem yourself? Break down the expression that give you the error until you locate the problem. This is exactly what we'd have to do.
Saying that, the problem looks obvious to me:
A=[a.*F b.*G c.*H 0; ...
a*F, b*G and c*H are 41x41 matrices. You then try to stick a 1x1 zero next to it. As the error tells you, that's not possible, everything you concatenate horizontally must have the same number of rows.
A = [a*F, b*G, c*H, zeros(size(x, 1), 1); ...
may work. It stick a 41x1 column vector of 0s to the end. Or you may have meant zeros(size(x)) which sticks a 41x41 matrix of 0s to the end.
You will of course have to do the same for the rest of the expressions, with zeros and ones.
8 件のコメント
Muhammad Ali
2020 年 1 月 22 日
Thanks. the error is removed but now a new error generated that 'Error in plot33 (line 19)
surf(U)' now kindly brief me how to handle it?
Guillaume
2020 年 1 月 22 日
Please give the full text of the error.
Muhammad Ali
2020 年 1 月 22 日
i have attached the file.
Muhammad Ali
2020 年 1 月 22 日
moreover the ful statement of error is
''Error using surf (line 57)
Z must be a matrix, not a scalar or vector.
Error in plot33 (line 21)
surf(x,t,U)''
Guillaume
2020 年 1 月 22 日
You need to review your U calculation. I've no idea what it's supposed to be, but it is clearly wrong. Your U is a ratio of determinants, so obviously it's scalar. You certainly can't plot a surface when you only have one value.
In addition, all the determinants are 0, so you're performing a 0/0 division which is undefined. Hence U is Nan + 1i*NaN.
Muhammad Ali
2020 年 1 月 22 日
why matlab is giving determinant 0, while in actual calculation they are nonzero.
is there any mistake in writing the matrices.
Muhammad Ali
2020 年 1 月 22 日
U is basically three soliton solution.
Guillaume
2020 年 1 月 22 日
"why matlab is giving determinant 0, while in actual calculation they are nonzero. is there any mistake in writing the matrices."
There might be an error in the way you wrote the matrix. I wouldn't know since I've no idea what they represent and anyway I don't have the time to analyse your matrices. You can check the determinant yourself with det(A), etc.
"U is basically three soliton solution."
Sorry, I don't understand this sentence. In any case, as I said, currently your U is the sum of two ratios of determinants, so it will always be scalar even if the determinants are not 0. It sounds like there's definitively a mistake in your U expression.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
タグ
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
