multiple variable function
古いコメントを表示
p=p*(cos((x(:,1))-sin(x(:,2)))
is it
p=p*(cosx1-sinx2)?
what is the difference between?
if its same,then why first one is used?
回答 (1 件)
Walter Roberson
2012 年 1 月 29 日
0 投票
The first uses trig functions, while the second does not.
The first uses two columns of a variable named "x", while the second uses a variable "cosx1" and another variable "sinx2".
The first is missing a ')', while the second has balanced brackets
4 件のコメント
Krishnendu Mukherjee
2012 年 1 月 29 日
Image Analyst
2012 年 1 月 29 日
You are so sloppy with your typing, that it's probably your main problem. cosx1 is NOT THE SAME as cos(x1). And x(;1) would cause a syntax error while x(:, 1) is perfectly valid.
Krishnendu Mukherjee
2012 年 1 月 29 日
Image Analyst
2012 年 1 月 29 日
You should get a new keyboard - they would be a very cheap fix. cos(x1) is the cosine of the variable x1. x1 is not necessarily the same as x(:,1) unless you said x1 = x(:,1); x1 could be anything at all. It could be pi, it could be 42, or 69 or anything else. Why would you think that x1 should automatically be the same as x(:,1) unless you made it so?
カテゴリ
ヘルプ センター および File Exchange で Surfaces, Volumes, and Polygons についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!