Is it possible to include LaTeX expressions as text in my code?

6 ビュー (過去 30 日間)
Daniel Pollard
Daniel Pollard 2021 年 1 月 13 日
コメント済み: Cris LaPierre 2021 年 1 月 18 日
I have a piece of code, where some of the variables can have their values chosen by me as and when I want. The values have very strict conditions however, given by equations like
.
a, c, m and b are all predetermined, and I choose gamma. I'd like to have this expression as a comment in the code as a reminder to myself, rather than having to keep track of other files or pieces of paper containing these conditions.
I know you can include LaTeX for when you publish the code, using
% $$ equation $$
but I want the expression to be directly visible in the code, not in a pdf version.

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 1 月 13 日
編集済み: Cris LaPierre 2021 年 1 月 13 日
It is possible if you use a live script. Live scripts are interactive documents that combine MATLAB code with formatted text, equations, and images in a single environment called the Live Editor. They actually function much like what you see on Answers.
  2 件のコメント
Cris LaPierre
Cris LaPierre 2021 年 1 月 13 日
The Creating a Live Script video walks through how to create a live script. it is part of our Exploratory Data Aanlysis course on Coursera.
Daniel Pollard
Daniel Pollard 2021 年 1 月 13 日
Excellent, it's about time I learnt to use Live scripts! Thank you.

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

その他の回答 (1 件)

adel behdani
adel behdani 2021 年 1 月 17 日
hi , i have been using matlab report generator and now i need to add an latex form equation in my report. is there any way to do so?
I would be really glad to know your comments...
tnx, Adel
  1 件のコメント
Cris LaPierre
Cris LaPierre 2021 年 1 月 18 日
See if this answer from the MathWorks Support Team works for you.

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

カテゴリ

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

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by