color graphic of a function in matlab
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Samuel Molinari
am 7 Mär. 2021
Kommentiert: Walter Roberson
am 12 Mär. 2021
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/542061/image.png)
hi i need to write this in matlab and make a graphic that looks like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/542066/image.jpeg)
i need to put the function in a code and make this graphic i dont know how to do either
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 7 Mär. 2021
Bearbeitet: Walter Roberson
am 7 Mär. 2021
Example:
xvec = linspace(0,10*pi, 100);
yvec = linspace(0,5*pi, 50);
[Xg, Yg] = meshgrid(xvec, yvec);
Zg = sin(Xg) .* tanh(Yg);
h = pcolor(Xg, Yg, Zg); set(h, 'edgecolor', 'none')
You will need to figure out how to effectively do the infinite summation.
7 Kommentare
Walter Roberson
am 12 Mär. 2021
if a is infinity and b is pi then the denominator is n*sinh(n*a*pi/pi) which is n*sinh(n*infinity). For all positive n that is n*sinh(infinity) and positive times infinity is positive infinity. So each term of the denominator is positive infinity.
When the denominator is infinity the results of the division are 0 except possibly if the numerator is infinity. Can the numerator be infinity? If y is positive then as n approaches infinity the sinh approaches infinity. But if x is positive then x*n approaches infinity and sin(infinity) is undefined, being anywhere in the range -1 to +1. You would need careful consideration of the possibility of +/-infinity divided by infinity. I suspect that the reasoning might be that the constant infinity in the denominator "approaches" infinity faster than the numerator that is not constant infinity, so I suspect that you always get 0, but I am not certain.
So for a infinity and b positive I believe that the sum is either 0 or (because of n infinite) undefined.
Walter Roberson
am 12 Mär. 2021
Maple says that with the denominiator being infinite that the terms are all 0 including at n = infinity.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!