mathml
기호 표현식에서 MathML 생성
설명
는 하나 이상의 이름-값 쌍 인수로 지정된 추가 옵션을 사용합니다. 예를 들어, chr
= mathml(f
,Name,Value
)DisplayInline
을 true
로 지정하여 인라인 표시용 MathML을 생성합니다.
예제
기호 표현식에서 MathML을 생성합니다.
syms x f = 1/exp(x^2); chr = mathml(f)
chr = '<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'> <msup> <mo>ⅇ</mo> <mrow> <mo>-</mo> <msup> <mi>x</mi> <mn>2</mn> </msup> </mrow> </msup> </math> '
DisplayInline
을 true
로 지정하여 인라인 표시용 MathML을 생성합니다.
syms x f = 1/exp(x^2); chr = mathml(f,'DisplayInline',true)
chr = '<math xmlns='http://www.w3.org/1998/Math/MathML'> <msup> <mo>ⅇ</mo> <mrow> <mo>-</mo> <msup> <mi>x</mi> <mn>2</mn> </msup> </mrow> </msup> </math> '
단위와 일부 특수 함수에 대한 MathML 툴팁을 사용하여 더 자세한 정보를 제공합니다. Tooltips
를 true
로 지정하여 툴팁을 생성합니다.
syms nu x f = besselj(nu,x); chr = mathml(f,'Tooltips',true)
chr = '<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'> <mrow> <msub> <maction actiontype='tooltip'> <mo>J</mo> <mtext>besselj</mtext> </maction> <mi>ν</mi> </msub> <mrow> <mo form='prefix'>(</mo> <mi>x</mi> <mo form='postfix'>)</mo> </mrow> </mrow> </math> '
웹페이지에서 MathML을 사용하는 경우 J에 커서를 올려놓으면 besselj가 포함된 툴팁이 표시됩니다.
sympref
함수를 사용하여 생성된 MathML을 수정합니다.
디폴트 기호 설정으로 표현식 π의 MathML 형식을 생성합니다.
sympref('default'); chr = mathml(sym(pi))
chr = '<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'> <mi>π</mi> </math> '
'FloatingPointOutput'
을 true
로 설정하여 기호 출력값을 부동소수점 형식으로 반환합니다. π의 MathML 형식을 부동소수점 형식으로 생성합니다.
sympref('FloatingPointOutput',true); chr = mathml(sym(pi))
chr = '<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'> <mn>3.1416</mn> </math> '
이제 기호 다항식의 출력 순서를 변경합니다. 기호 다항식을 만들고 'PolynomialDisplayStyle'
을 'ascend'
로 설정합니다. 오름차순으로 정렬된 다항식의 MathML 형식을 생성합니다.
syms x; poly = x^2 - 2*x + 1; sympref('PolynomialDisplayStyle','ascend'); chr = mathml(poly)
chr = '<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'> <mrow> <mn>1</mn> <mo>-</mo> <mrow> <mn>2</mn> <mo form='infix'>⁢</mo> <mi>x</mi> </mrow> <mo>+</mo> <msup> <mi>x</mi> <mn>2</mn> </msup> </mrow> </math> '
sympref
를 사용하여 지정한 설정은 현재 세션뿐만 아니라 이후의 MATLAB® 세션까지 계속 적용됩니다. 'default'
옵션을 지정하여 디폴트 값을 복원합니다.
sympref('default');
입력 인수
입력값으로, 기호 숫자, 기호 변수, 기호 배열, 기호 함수 또는 기호 표현식으로 지정됩니다.
이름-값 인수
선택적 인수 쌍을 Name1=Value1,...,NameN=ValueN
으로 지정합니다. 여기서 Name
은 인수 이름이고 Value
는 대응값입니다. 이름-값 인수는 다른 인수 뒤에 와야 하지만, 인수 쌍의 순서는 상관없습니다.
R2021a 이전 릴리스에서는 쉼표를 사용하여 각 이름과 값을 구분하고 Name
을 따옴표로 묶으십시오.
예: mathml(f,'Tooltips',true)
인라인 MathML 표시로, 'DisplayInline'
과 함께 true
또는 false
(디폴트 값)가 쉼표로 구분되어 지정됩니다.
MathML 출력의 툴팁으로, 'Tooltips'
와 함께 true
또는 false
(디폴트 값)가 쉼표로 구분되어 지정됩니다. mathml
은 단위 및 일부 특수 함수에 대한 툴팁을 추가합니다.
버전 내역
R2018b에 개발됨
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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)