I am trying to make a phase diagram for three variables required phase diagram. a=[0.01 0.5 1 1.5 2]; b=[0.1 1 2 5 10];
and their mean squared error value in variable 3 (having 5 rows and 5 columns) mse =

0.0000    0.0284    0.0311    0.0177    0.0112
0.0113    0.0381    0.0449    0.0339    0.0236
0.0517    0.0800    0.0768    0.0701    0.0659
0.1052    0.1099    0.1128    0.1154    0.1104
0.1499    0.1382    0.1350    0.1499    0.1504


I have tried contour, contourf, imagesc and many different builtin functions but I couldn't get the required phase diagram. My results looks like this below [my phase diagram looks like this2. I am new to MATLAB could someone please point out my mistake? I need the first one as a result

I tried this as well figure; pcolor(a,b,mse); shading interp; still the results look different, something like this enter image description here

  • $\begingroup$ Do you have any idea what you are after? To my limited understanding phase diagrams are used to declare different phases of a process (such as liquid, solid phase of water). Would you like to elaborate a little bit or at least provide an example of what you are trying to achieve? $\endgroup$
    – ZaellixA
    Commented May 30, 2023 at 11:14
  • $\begingroup$ I want to plot phase diagram of mean squared error as a function of two parameters (a and b). The color indicates the mse and blue region means low mse value. For example I am checking the influence of two parameters on mean squared error value. In order to get the low mse what should be the optimal value of a and b. $\endgroup$
    – Abeeha
    Commented May 30, 2023 at 11:37
  • $\begingroup$ The last two pictures you provided seem to be what you are asking... They plot the MSE and the axes are the vectors a and b. So what is it that is not working? $\endgroup$
    – ZaellixA
    Commented May 30, 2023 at 12:40
  • $\begingroup$ I want the phase diagram to look like 1st image but my code is giving me 2nd or 3rd image. is there any problem with 3rd image for my case? how to correct the code to get the 1st image as a result? $\endgroup$
    – Abeeha
    Commented May 30, 2023 at 15:13
  • 1
    $\begingroup$ The data do not seem to coincide. Have a look at the data in your MSE matrix, they don't seem to have the same "pattern" as the first image. Are you sure the first image is made with the data you provide in the MSE matrix? Regarding the last image, it is actually the second image but "upside-down" since when you plot images, the [0, 0] coordinate is assumed to be on the top-left corner (image processing convention). Other than that, it's just an interpolated version of the second image. $\endgroup$
    – ZaellixA
    Commented May 30, 2023 at 15:21


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.