Plotting in Matlab using Latex Interpreter

Nowadays, it is customary to display any data in the form of graphs. After all, the human brain can easily perceive visual data. So, no one is to blame.

As a science guy, I use a lot of math notation (mostly from Greek). These symbols exist in Matlab, but of course you don't use them in the editor, because we all know the pain of typing math equations (using these symbols) in our reports. That's why the Matlab code looks like this

clear all;
alpha = -10:10;
beta = 2.*alpha;

instead of this

clear all;
α = -10:10;
β = 2.*α;

By the way, in line 3, I used .* instead of just . to instruct matlab that it is element-wise (beta = [ 2*(-10), 2*(-9), 2*(-8 ), …, 2*(8), 2*(9), 2*(10) ] instead of matrix multiplication (beta = [-10, -9, -8, …, 8, 9, 10] * [ -10, -9, -8, …, 8, 9, 10] * [-10, -9, -8, …, 8, 9, 10] … 10 times).

Back to our topic...if symbols are not used in code, where are they used? You must have guessed it from the title. They are used for plots. Because plot matters. They are the ones who go into the presentation.

So, I happily put some of my alphas and betas together in one plot, and this happened.

clear all;
alpha_real = -10:10;
alpha_imaginary = 2.*alpha_real;
plot(alpha_real, alpha_imaginary)
xlabel('alpha_real','FontSize',20);
<

Guess you like

Origin blog.csdn.net/code2day/article/details/131273003