Create a matrix with letters

조회 수: 7 (최근 30일)
Lee Cohen
Lee Cohen 2018년 4월 6일
댓글: Lee Cohen 2018년 4월 7일
I would like to know how to create the following matrix:
When there is a list of points with weights (xi, yi, zi are coordinates and mi are weights) I just don't know how to create it with those letters.
  댓글 수: 4
James Tursa
James Tursa 2018년 4월 6일
편집: James Tursa 2018년 4월 6일
Are you trying to form a symbolic matrix? How is this going to be used downstream in your code?
Lee Cohen
Lee Cohen 2018년 4월 6일
편집: James Tursa 2018년 4월 6일
Yeah, I tried to write this code:
n = input('enter n\n');
syms m x y z
m x y z=ym('m x y z', [n 1]
I am trying to create this matrix using the information from
but I get error.

댓글을 달려면 로그인하십시오.

답변 (1개)

James Tursa
James Tursa 2018년 4월 6일
Is this what you want:
A = [sym('m%d',[n 1]) sym('x%d',[n 1]) sym('y%d',[n 1]) sym('z%d',[n 1])]
  댓글 수: 1
Lee Cohen
Lee Cohen 2018년 4월 7일
yes, thank you so much!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by