已回答
Can't use fsolve to solve system of equations (4 unknowns)
I would suggest you put everything in a loop where at each iteration you solve for a different values of phi2. Moreover, at eac...

2 years 前 | 0

已回答
Finding minimum output value for same inputs in a table
clear,clc % The following matrix has two rows which have same x-y-z but different % output (namely, first and last rows) ...

2 years 前 | 0

已回答
Difference of elements of vector and matrix
If the values of B are to be found strictly in the first row of A, then use this clear,clc A = [1, 2, 3, 4 ; 5, 6, 7, 8]; B...

2 years 前 | 1

已回答
How solve this problem in Matlab
Note that your code displays a lot of matrixes because you haven't placed a semicolon when defining V. You can fix it easily c...

2 years 前 | 0

| 已接受

已回答
Print a value on a plot
I'd recommend taking a look at this https://ch.mathworks.com/help/matlab/ref/text.html Make sure to use num2str to convert the...

2 years 前 | 0

已回答
how to add + - 1% Noise to a constant input Power in order to make the output signals look like real ? thank you very much
One example x = 1:1000; y = ones(size(x)); % Your signal n = diff(0.1*rand(2,size(x,2)),1); % Arti...

2 years 前 | 0

| 已接受

已回答
if temperature 17 increase until 23, swich on,Q=15*10^6 and if temperature 23 decrease untill17 switch off, Q = 0 how can I plot the temperature with time when T(0)=20degree
You could try this clear,clc tf = 3; % Final time of integration T0 = 20; % Initial temperat...

2 years 前 | 1

已回答
How do you sum concatenated variables in a system of ODES with a For Loop?
This should do it for any N N = 3; [t,X] = ode45(@(t,C)model(t,C,N),[0,2],rand(1,N)); plot(t,X) legend('c1','c2','c3') fu...

2 years 前 | 1

| 已接受

已回答
How to write my function output in various form?
Simply, your function should look like this function [out1,out2,out3,out4,out5,out6,out6] = yourFunction(input) ... ... ... ...

2 years 前 | 0

已回答
Need to find the distance on the x axis between my two peek points
clear,clc % This just recreates your type of data x = (0:0.01:2*pi)'; y1 = sin(x)-0.5*x; y2 = flip(y1)-0.25*x; y = [y1,...

2 years 前 | 0

| 已接受

已回答
Reiterate a function from an initial value
clear,clc dThetaS = zeros(1,10000); dThetaS(2) = 2; dTheta = 1; dThetaD = 1; Ka = 1; idx = 2; while abs...

2 years 前 | 0

| 已接受

已回答
How to attach multiple matrices to a single matrix?
The code below will keep repeating the values form each array 5 by 5, i.e. it won't use only the first 5 values of each array. ...

2 years 前 | 0

| 已接受

已回答
How to reduce matrix size conditionally?
You could use the max function. See below % here I reproduce your type of matrix A = rand(194,1); A = [A,A,A,A,A]; A(logical...

2 years 前 | 0

已回答
Convert portion of matrix under the diagonal to column vector
A = [ 1 2 3 4 5; 2 1 2 3 4; 3 4 1 2 5; 4 3 2 1 2; 5 4 3 2 1]; A = tril(A,-1)'; A = A(:); A(A==0) = []; A = A'

2 years 前 | 1

已回答
Count of total pixels and dimensions(rows and columns) of a picture?
grayImage = imread('retina.jpg'); numberOfPixels = numel(grayImage) [rows,cols] = size(grayImage)

2 years 前 | 0

| 已接受

已回答
fill area between two curves
I think the problem might be that your y-values are column vectors, and therefore you create a matrix when you concatenate them ...

2 years 前 | 0

已回答
How to ignore certain columns in a matrix when calculating a mean across all columns in a matrix?
See if this works new_S_or_z = S_or_z(:,(max(S_or_z,[],1)-min(S_or_z,[],1)) < 200); plot(new_S_or_z) mean(new_S_or_z,[],2)

2 years 前 | 0

| 已接受

已回答
random assignment to 1s in a matrix
c = randi([0,1],69,10) % This replaces your biricinfaz, didn't want to copy that ;) c(logical(c)) = randi(1...

2 years 前 | 1

已回答
Write a function that takes a number to be guessed and a player number, and checks if the winning criteria is met.
It could be something like this numberGuess([3,7,12,9,17]) function numberGuess(input) if length(input) ~= 5 error('In...

2 years 前 | 0

已回答
how to plot this function
clear,clc x = -1:0.1:1; psi0 = (pi^-0.25)*exp(-x.^2/2); plot(x,psi0)

2 years 前 | 0

| 已接受

已回答
I got two different graphs from my code like ODE89 and Eulers method. I need to compare the graphs in it.
clc clear all %% ODE89 A0=1; B0=3; P0=0; K=5*10^-5; Yb=1; Yp=0.15; tspan = [0 43200]; [x,Y] = ode89(@(t,Y) odef...

2 years 前 | 1

| 已接受

已回答
Finding maximum value and returning variable name of the column
clear,clc A = [1;2;3;4]; B = [5;4;1;2]; C = [2;3;2;5]; T=table(A,B,C); [maxval,idx] = max(table2array(T),[],2); T.Prop...

2 years 前 | 1

| 已接受

已回答
How to generate pattern randomly In MATLAB
This is another approach based on the comments under my previous answer. It tries to implement the request by @Med Future that:...

2 years 前 | 0

| 已接受

已回答
How to generate pattern randomly In MATLAB
clear,clc n = 16; % Number of levels L = randi(1000,n,1); % Level values x = 1:1000; y = ones(size(x)...

2 years 前 | 0

已回答
I need help finding y on a plot knowing x
Let x and y be your dataset extracted from excel, to find y0 at x0, you can use the following code. y0 = interp1(x,y,x0); For ...

2 years 前 | 0

已回答
Plot array with increment
Just type plot(x,y)

2 years 前 | 0

已回答
how to plot v-t graph for v=v0(e^-kt)?
Try this clear,clc v0 = 1; k = 1; t = linspace(0,10,100); v = v0*exp(-k*t); figure plot(t,v)

2 years 前 | 0

已回答
How do I combine four 3x3 matrices into a 6x6 matrix?
If it's really only 4 matrixes, then I would just write New = [[A,B];[C,D]]; If the code needs to be expanded for a larger num...

2 years 前 | 0

| 已接受

已回答
Inserting columns of one matrix between the columns of another matrix
You can do that using a for loop clear,clc sorted_grid = rand(24,365); index = rand(24,365); combined = [zeros(...

2 years 前 | 0

| 已接受

已回答
why range of x axis of time is not showing
That's happening because all the values of X,Y, and Z after T = 1.5 are NaN, which will not be plotted by MatLab. I guess there...

2 years 前 | 0

加载更多