Matrix multiplication of different sizes

1 回表示 (過去 30 日間)
Richárd Tóth
Richárd Tóth 2019 年 8 月 4 日
回答済み: Walter Roberson 2019 年 8 月 4 日
Hello
I can't store equations like these x1,...,xn equations here: https://en.wikipedia.org/wiki/N-sphere#Spherical_coordinates
The problem is that phi(n-1) is from 0 to 2pi while the rest of phi is from 0 to pi, so if I do something like this:(n=3)
phi1=0:0.1:pi;
phi2=0:0.1:2*pi;
then multiply them, it will throw an error about different sizes. Should I just modify phi1 to
phi1=0:0.05:pi
so they have the same size? I'm not sure how that affects the equations.
  2 件のコメント
Guillaume
Guillaume 2019 年 8 月 4 日
You haven't explained what you're trying to do.
Whatever angle, or range of angles you use doesn't have any effect on the equations. the equations are true regardless of the inputs. Of course, the angles you put in do affect the result.
Richárd Tóth
Richárd Tóth 2019 年 8 月 4 日
編集済み: Richárd Tóth 2019 年 8 月 4 日
I use them in a semi infinite optimization problem, semi infinite because the phis can have infinite values(they are in constraints) , so I create finite vectors of them, they are the sample sets

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

採用された回答

Walter Roberson
Walter Roberson 2019 年 8 月 4 日
N = 50;
phi1 = linspace(0, pi, N);
phi2 = linspace(0, 2*pi, N);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by