matlab-figure

How to animate this 3D plot in Matlab?

 ̄綄美尐妖づ 提交于 2019-12-25 03:52:00
问题 My current code : a=7 f=10 T=1/f; v=40 wl=v/f; x1=1; x2=30 step=0.01 t=x1:step:x2; x=x1:step:x2; y=a*sind(2*pi*f*(t+(x*T)/wl)); h=plot3(x,y,t); set(h,'EraseMode','xor','MarkerSize',20) xlabel('displacement(m)'); ylabel('amplitude(m)'); title('Wave Animation'); for t=x1:step:x2 drawnow y=a*sind(2*pi*f*(t+(x*T)/wl)); set(h,'YData',y) pause(0.01) end I converted it to a 3D mesh plot but it takes ages to render in animation and Matlab crashes. a=7 f=10 T=1/f; v=40 wl=v/f; x1=1; x2=30 step=0.01 t

how to save matlab neural networks toolbox generated figures

被刻印的时光 ゝ 提交于 2019-12-25 02:58:06
问题 In the matlab workspace the output/results can be easily saved. But when I train the network with some data to see the performance of the training (In Neural Network Toolbox), the regression plots along with the histograms and performance plots can not be saved as a figure file.currently i am using snipping tools to capture them. My Question is how to do that? Is there any options to save those plots(generated in Maltab Neural Network toolbox)? I would be grateful to have any codes/ answers

How do I generate a 3d plot from an adjacency matrix using force directed algorithm

拜拜、爱过 提交于 2019-12-25 01:55:17
问题 I have created a code that accepts an adjacency matrix as input from a user and create a 3d scatter plot of the matrix. I want to assign a repulsive force between unconnected nodes and an attractive force between connected nodes such that the nodes are displaced according to the net force acting on them. This has to be in 3d. 回答1: Here is an example showing how, given an adjacency matrix and the coordinates of the vertices, we plot a 3D scatter of the graph: %# sample adjacency matrix and 3D

Transparent background for identification of 0 and 1 in a MATLAB figure [duplicate]

こ雲淡風輕ζ 提交于 2019-12-25 00:15:21
问题 This question already has an answer here : Highlight parts of matlab plot (1 answer) Closed 2 years ago . I've sunlight and eclipse detection in my code. I'd like to highlight sunlight and eclipse detection in every plot I'm generating. Suppose sun_avail = 0; % means spacecraft is in eclipse sun_avail = 1; % means spacecraft is in sunlit I've set of variables (vectors (X,Y,Z)) needed to be plot in matlab figure which I'd do like this fig = figure(); set(fig, 'name', 'Quaternions',

Does anybody know how should I use animatedline in order to draw me an orbit immediately?

荒凉一梦 提交于 2019-12-24 19:36:00
问题 This is the main code %%%%%%%%%%%% Valori pentru Rcsc %%%%Pozitiile si vitezele pe cele 3 axe y0(1,1)= 743322.3616 ; y0(2,1)= -6346021.219 ; y0(3,1)= -3394131.349 ; y0(4,1)= 5142.38067; y0(5,1)= 4487.44895 ; y0(6,1)= -7264.00872; %%%% Timpul tspan=[0 :864]; %%%% Masa(kg) si aria suprafetei satelitului (m^2) m = 217 ; %320; A = 1.2; %8; %%%% Metoda Runge-Kutta de ordin 4 h=1; y = zeros(6, tspan(end)/h); y(:,1) = y0; for i=1:(tspan(end)/h) H=sqrt(y(1,i)^2+y(2,i)^2+y(3,i)^2); k_1 = proiectia

non-homogenous grouped data in MATLAB plotyy()

匆匆过客 提交于 2019-12-24 17:24:58
问题 I have to plot 1 line plot and 3 grouped scatter plots in a single plot window. The following is the code I tried, figure; t1=0:0.1:10; X = 2*sin(t1); ts = 0:1:10; Y1 = randi([0 1],length(ts),1); Y2 = randi([0 1],length(ts),1); Y3 = randi([0 1],length(ts),1); plotyy(t1,X,[ts',ts',ts'],[Y1,Y2,Y3],'plot','scatter'); %plotyy(t1,X,[ts',ts',ts'],[Y1,Y2,Y3],'plot','plot'); The following are my questions, The above code works if I replace 'scatter' by 'plot' (see commented out line), but 'scatter'

Matlab openfig to existing figure

自作多情 提交于 2019-12-24 16:54:30
问题 When in Matlab I use openfig(filename); to open a saved figure, it always opens a new window. All the 'reuse' argument does is not load the file when it appears to already be open. However, I wish to open the file into a given figure , and just overwrite its contents. Is there a way to pass a figure handle to openfig , or is there another function that would accomplish this? So in code, what I would like to do is something along the following lines: f = figure; openfig(filename, 'Figure',f);

Matlab drag and drop file from windows explorer to figure (gui)

柔情痞子 提交于 2019-12-24 14:23:08
问题 I would like to know it there is a way to drag a file from Windows explorer and drop it in my GUI. The goal should be to get the file path (or folder path) and be able to load it with my own loading function. I precise that I am using Matlab 2015b in Windows 10 64bits. I edit my post to give an code example of what I am trying to do (based on Yair Altman solution and other found in Internet) : function demo % Set-up a figure droppable axis hFig = figure('name','DND example','numbertitle','off

Adding extra information to datapoints on a plot

主宰稳场 提交于 2019-12-24 13:43:26
问题 THERE IS THE SOLUTION BELOW! This (x,y) value actually corresponds to a t value, which I want to see on the plot. What can I do? Clearly matlab has the ability to display multiple information in the datapoint box: just call it as "TimePlot(x,y,t)" and it will work. This code, I believe, also illustrates a few key points in modifying datatips. function TimePlot( varargin ) x=varargin{1}; y=varargin{2}; t=varargin{nargin}; fh=figure; plot(varargin{1:nargin-1}) function output_txt = myfunction

Modifying font size for pie chart lables

最后都变了- 提交于 2019-12-24 11:35:49
问题 I am using a simple script for a pie chart, but I am unable to change the font size of the pie labels. Is there an easy way to change it? Below is my plotting code: h = pie ([0.1,0.1,0.1,0.1,0.1], {"unlikely","possible","likely","very likely","certain"}); y = 0; n = 1; colormap([1 1 n; %// unlikely 1 1 y; %// possible 1 1 y; %// likely 1 1 y; %// very unlikely 1 1 n;]) %// certainly ax = gca(); set(ax,'fontsize', 18); view([270, -90]) 回答1: The variable h contains an array of five Patch