Can I make this kind of graph in matlab?

1 Ansicht (letzte 30 Tage)
Anthony
Anthony am 29 Jul. 2014
Kommentiert: Star Strider am 30 Jul. 2014
Sorry, I don't know what to call it. Here's a screenshot:

Akzeptierte Antwort

Star Strider
Star Strider am 29 Jul. 2014
I don’t know exactly what sort of format the data is that you’re plotting in those (it seems to be host response to an infectious agent of some sort) but you can likely reproduce plots like that with the image, colorbar and colormap functions. You will have to experiment with them to get the result you want.
  6 Kommentare
Anthony
Anthony am 30 Jul. 2014
Sorry for the late response.
The paper has only the results and it doesn't mention the software that was used. The system of ODEs is dX as in this question. If you care to look, the paper is here. I tried using 'Immune System' as the 't' in the ODE solver by replacing the original tspan with the domain of the figure. I could not get it to run (I'm not doing what you're asking maybe).
I think the biggest part of my confusion is plotting the varying parameters which come from my system dX. I can't find anything through a search with google that's remotely close to what I'm working with. When trying to plot solutions vs. parameter, I was told to use a for statement (what you see in the question I have linked). Now I'm trying to plot parameter vs. parameter, so should I have a nested for statement?
Star Strider
Star Strider am 30 Jul. 2014
I apologize for not wanting to read and understand a 35-page paper just now, so I simply scanned it. (It is in an area of my expertise, and looks very interesting, but I have other things I need to read.) If you use an independent variable, for instance ‘I’ here, in place of time (perfectly legitimate), you can’t null it with ‘~’ in your ODE arguments. You also have to define it with respect to your ODE variables, for instance:
function dX = ode(I,X,T)
to tell your ODE to treat ‘I’ as your independent variable.
With respect to your for loop, I suggest you change it to:
treatment = 1e-4:1e-5:1e-3;
for k1 = 1:length(treatment)
[t(:,k1),X(:,:,k1)] = ode45(@ode, [0 4.5e4], [1e4 0 0], [] , treatment(k1));
end
I didn’t run this, so be sure ‘X’ is saved correctly, but since the outputs of the ODE functions are column variables, it should work. Taking the plot call out of your loop will speed things up considerably. Plot the appropriate variables (saved in t and X) outside the loop. If you define ‘t’ as something else (for instance ‘I’), you might want to define it with that variable name in the output of your ode45 call. Also, you didn’t say exactly how you were using it as tspan, but rather than a two-element range, I suggest you use a vector of defined values for ‘I’.
That should get you going. I’ll follow this until your code works, which it should since the paper’s authors got it to work.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by