Respondida
Pass plot parameters as a vector
x = linspace(0,1,10); % I changed the domain so you can see the lines y(1,:)= exp(x); y(2,:) = log(x); y(3,:) = x.^2; colors...

3 meses hace | 0

Respondida
Projectile Motion when y0 does not equal 0
clear all close all clc g= -9.81; % gravitational acceleration angle= 45 *pi/180 ; % angle in radian % v0=2; % initial sp...

3 meses hace | 0

Respondida
plot x label like plot(x, y) in boxplot
data = magic(5); x=[1,2,5,10,16]; boxplot(data,x);

3 meses hace | 1

Respondida
Summing the values inside a while loop
scores = []; ii = 1; while ii <= 10 scores(end+1) = rand(); ii = ii+1; end scores sum(scores)

3 meses hace | 0

Respondida
Why is MATLAB not making multiple plots when I specify separate figures?
figure(2) makes Figure 2 the current figure, if it exists, or creates a new figure called Figure 2 if it does not already exist...

3 meses hace | 0

Respondida
Vectorising nested for loops
% unzip and load data unzip data.zip load data.mat % run the loop method, for later comparison k=0; struct_data = struct(...

3 meses hace | 1

Respondida
Graphing specific function over time
t = linspace(0,10,100); da = 0.5+0.425*sin(2*pi*60*t); plot(t,da)

3 meses hace | 1

Respondida
How to write a circuit value whit complex numbers
I = 220*cos(50*t+30)/52.4;

3 meses hace | 0

Respondida
I need my code to loop while my input is binary (ones and zeros). once the user inputs any other value then the loop should stop.
while true bin = input('Input binary number: ','s'); if ~all(bin == '0' | bin == '1') break end D =...

3 meses hace | 0

Respondida
what am I doing wrong here? It keeps saying my value for d is incorrect
d=(-cosd(60)/6)+(exp(3.*y)+(x.*y./(z.^3)).*((z./2).^(-3/4))).^3 % ^ ^ you ...

3 meses hace | 0

Respondida
Plot with different shapes
A = 2*rand(10,1); B = 20*rand(10,1); C = 30*rand(10,1); grid on box on hold on x = 1:10; y = A; yyaxis left plot(x,y,'p...

3 meses hace | 1

Respondida
How do I extract from array with values I got from that same array?
% call peaks() to get the indices of the peak(s), based on the 2nd column of ICA: peak_indices = peaks(ICA(:,2)); % get the ...

3 meses hace | 0

Respondida
Edit matrix with condition
idx = mm(:,7) <= 0.0115 & mm(:,7) > 0.01; p_n = mm(idx,1:2); v_n = mm(idx,3:4); p_b = mm(~idx,1:2); v_b = mm(~idx,3:4);

3 meses hace | 1

Respondida
Select X, Y coordinates randomly but only do each pair 5 times
X_vector = [3; -3; -9; -15; -21; -15; -9; -3; 3; 3; -3; -9; -15; -21; -21; -15; -9; -3; 3; 3; -3; -9; -15; -21; -15; -9; ...

3 meses hace | 0

Respondida
Error using evalin Undefined function or variable 'var'.
This line evalin('base',"Port=var;"); evaluates "Port=var;" in the base workspace. Apparently you don't have a variable called...

3 meses hace | 1

Respondida
plot based on a value
% random vectors (10x1) of values between 0 and 2 AA = 2*rand(10,1); BB = 2*rand(10,1); CC = 2*rand(10,1); DD = 2*rand(10,1)...

3 meses hace | 1

Respondida
I need to combine those three martix into a single big one. How do I do that?
See blkdiag: https://www.mathworks.com/help/matlab/ref/blkdiag.html

3 meses hace | 0

Respondida
How to sum values from a cycle
After the loop: ang_sum = sum(ang);

3 meses hace | 0

Respondida
Trying to plot 20 points on top of an image for a curve. After solution in class was posted, when running it I get "Conversion to double from cell is not possible." Why?
Change the function mybezier to return a double rather than a cell array, i.e., remove the {} filename = "peppers.png" [y,z] =...

3 meses hace | 0

Respondida
How to set default axes tick using groot?
set(groot,'DefaultAxesXMinorTick','on','DefaultAxesYMinorTick','on')

3 meses hace | 0

Respondida
for loop over video data
Does this work as expected? [n_frames,n_rows,n_columns,n_color_channels] = size(data); block_size = 30; n_frames_to_process =...

3 meses hace | 0

Respondida
I'm getting an error using fplot, How do I get it to work?
Xs = 1.8; fs = 10; fi = pi/3; t1 = -0.1; t2 = 0.2; t = [t1, t2]; x = @(t)Xs*sin(2*pi*fs*t+fi); fplot(x,t,'-')

3 meses hace | 1

Respondida
How to display an image and a plot on the same figure while controlling axes
my_image = uint8(linspace(1,0,720)'*linspace(1,0,1280)*255); % some diagonal color gradient angles = linspace(0,4*pi,200); m...

3 meses hace | 1

Respondida
Variable might be set by non scalar operator
m=('insert value'); should be m=input('insert value');

3 meses hace | 0

Respondida
Manipulate strings in a table- remove leading numbers if present

3 meses hace | 0

Respondida
Patch - controlling transition of transparency - how to?
To have all patches span the full transparency range, use normalized values, where each column of fit is normalized separately. ...

3 meses hace | 0

Respondida
Why does the line plot depend on the generator type in a for loop ?
The i_subset passed in to make_line_plot.m is a column vector, and that is assigned to generator if mode == 1. Then generator is...

3 meses hace | 1

Respondida
How can I set zero value to white? in mesh plot
Like Rik said, one option is to replace zeros with NaNs in A; then they won't show up at all (so by default you see the white ax...

3 meses hace | 0

Respondida
How to list all situation of vector including fix number?
perms(1:10) https://www.mathworks.com/help/matlab/ref/perms.html

3 meses hace | 0