problem in plotting data
1 view (last 30 days)
Daniele Sonaglioni on 12 Nov 2021
I am doing a fit with a complex function: the code seems to work correctely but I cannot plot the data.
Do you have suggestion about what the problem is?
I attach the code I am working on and the data.
Thank you all!
Cris LaPierre on 12 Nov 2021
I changed your post to executable code and ran in here. Two plots were created. Are those the figures you are trying to create? I suspect you expect to see a line in the second plot?
Upon inspection, the result of fit_funw(r) is a single number, 902.5728. It is not a complex number, so the result of imag is 0.
By default, the plot function does not include a markerstyle. It just plots using a solid line. When you data is a single point, you cannot see that line. This is because norm returns a single value for a vector input. Specify a marker style for the second plot.
If you expect fit_funw to return a vector, please check your approach.