How to use markers in MatLAB - matlab

I need to plot some results in Matlab. Using plot3 worked just fine, one problem did occur, though.
I use the following
plot3(x,y,z,'-rv')
How can I change the above code, so the markers appear on one, last, node only?
Any help would be much appreciated.
--
grnspn

You can plot using two separate commands:
plot3(x,y,z,'-r')
hold on
plot3(x(end),y(end),z(end),'rv')

Related

Strange straight line in flutter fl_chart

I have a line chart that builds by a combination of several data. But the curve draws some strange straight lines on some areas.
How can i delete this line?
The problem is i think not related to the data because icannot touch with cursor to this straight line. I think curve automatically draws something like regression line, but icouldn't remove it.
Thank you.
Another example
if i chose dot data as true, you can see that there is no data point on these straight lines.
I solved my problem. For those who has the same issue, the data of the curve should be sorted. If your data is map, just turn the map to sorted with collection package with the following code;
data = SplayTreeMap();
That's it.

Visaulize several .vtk files together in Paraview

I am running some simulations on Matlab and then passing them to Paraview using .vtk files. I would like to see all three .vtk files together in Paraview screen but it seems like I can visualise them only one by one, not together.
Anyone knows how to solve this?
Thanks in advance.
It's possible to visualize several .vtk files together in Paraview.
Just hit "Ctrl+O" and select the files you want to visualize.
After that you have to hit apply in any of the loaded files in order to update the pipeline.
Watch out for naming!
If you name your files like:
file1.vtk
file2.vtk
file3.vtk
They will be loaded as a TimeSeries and visualized as an animation. One at a timestep.
Hope it helped!
With ParaView 5.3, you can apply the Group TimeSteps filter, to group all the timesteps into a single multiblock dataset with each timestep added as a separate block.

Matlab GUI, create two tabs

I want to create two tabs within one GUI. One can show the plot of sine function, the other shows cone function. I can handle these two functions. but i do not know how to create two tabs. Thanks a lot!
If by tabs you mean 'plotting area' then you likely need to create 2 axes objects and display each plot in its own axes. In GUIDE it's very easy...more info here.
Let's say you have axes1 and axes2, you can do this:
axes(axes1) % Make axes1 the current axes.
plot(sin(...))
axes(axes2) % Make axes2 the current axes
plot(...)
and that's it. Hope this is what you mean! If not sorry I misunderstood the question.
EDIT
I thought about it and I'm probably wrong about what I thought a tab is. Matlab does not allow to do it directly, although it might be possible with the GUI Layout Toolbox. Here is a submission from the FIle Exchange which could be interesting to you: link here!. Sorry abut the confusion.
uitab() can be used for creating tabs. If you want to create tabs using guide it's currently not natively supported but possible with a work around I described here.

Matlab: linkaxes squeezes my graph

I have drown several graphs thanks to "subplot" function on MatLab and it works well.
Nevertheless, I want all my graphs to have the same Y-scale so that I can compare them.
I used the "linkaxes" function and my all my graphs have the same scale but the problem is that some of my figures are "beheaded", lacking their upper part, or one of my figures is completely squeezed.
I don't get what happened. Could you please help me to solve the problem or tell me about another function that would be more appropriate in my case?
Here's part of my code:
for i=1:1:9
m=n(i);
fichier=sprintf('%d.txt',m);
M=load(fichier);
z=length(M(:,1));
x=M(1:z,1);
y=M(1:z,2);
a(i)=subplot(2,4,i)
contour3=plot(x,y)
linkaxes(a,'y')
end
linkaxes creates a permanent link between the scales of several axes, so that you can subsequently perform zoom operations (perhaps interactively) on one, and have the other automatically update.
If you need that functionality, then linkaxes is the right command (although you could possibly also look at linkprops).
However if all you need is to ensure that the y-axis limits of your axes are the same, it will probably be easier (and you will have more control) if you set them directly. You can retrieve the y-axis limits using ylim(axis_handle) and set them using ylim(axis_handle, [lower, upper]), or alternatively with get(axis_handle,'YLim') and set(axis_handle,'YLim',[lower,upper]). You might also look at the YLimMode property of the axis, which determines whether the axis limits are directly set or automatically resized.

AChartEngine graph using two y axis

I am currently trying to create a graph using AChartEngine containing two y-axis (one to the left, one to the right). Yet, I cannot seem to figure out how I can actually add the second y-Axis. An XYMultipleSeriesRenderer only has got one setYTitle() method.
Has someone ever achieved this and can give me a hint?
Thanks,
Matthias
You can do that, indeed. Please see an example for this here.
The result looks like
.