フィルターのクリア

Calculate matrix from symbolic equation

4 ビュー (過去 30 日間)
jnaumann
jnaumann 2013 年 9 月 19 日
Hi everyone,
I have used the following code to generate a symbolic equation for a plane given 3 points.
P1=[1747 444 1051];
P2=[1771 115 1053];
P3=[9 290 66.05];
normal = cross(P1-P2, P1-P3);
syms x y z;
P = [x,y,z];
planefunction = dot(normal, P-P1);
dot(P-P1, normal);
realdot = @(u, v) u*transpose(v);
realdot(P-P1,normal);
zplane = solve(planefunction, z);
I would now like to generate an m x n matrix (3506 x 1057) using this equation but keep getting stuck. Does anyone know how to do this? I am sure it is very simple
Many thanks in advance
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 9 月 19 日
What exactly is your problem? is there any error message?
jnaumann
jnaumann 2013 年 9 月 19 日
No, I haven't got to that stage yet. I have the equation describing the plane. I just don't know how to generate a matrix using that equation. Say I want to generate a 2D matrix where x=1:3000 and y=1:1000 for example, how can I do this?
Thanks

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

回答 (1 件)

Sean de Wolski
Sean de Wolski 2013 年 9 月 19 日
zp = subs(zplane,{x,y,z},{1:100,1:100,1:100})
To get a numeric solution from this:
double(zp)
  1 件のコメント
jnaumann
jnaumann 2013 年 9 月 19 日
Thanks for your quick response. I have tried the code you provided. Should this produce a matrix or vector since when I plot the answer I get a line. Is this expected and how to I change it to get a matrix(to plot a surface)?
Cheers

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

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by