已回答
HOW TO CODE AND PLOT EQUATION
You are missing multiplication operator between 'k' and t^n. MR = a*exp(-k*(t^n))+b*t

3 years 前 | 0

已回答
least square fitting with a data set
You can use sgolayfilt() or 'smoothingspline' option from curve fitting toolbox. See the answers here for detailed discussion on...

3 years 前 | 0

已回答
Coding bug - IF statement
Comparing arrays like this does not work properly with the if-else block. See the output of your comparison >> a=[1;0;0] b=[0;...

3 years 前 | 1

| 已接受

已回答
How to plot the opposite direction field
Try this quiver(x, y, 1./u, 1./v);

3 years 前 | 0

| 已接受

已回答
Plotting third order differential equation using ode45
You need to convert this 3-rd order ODE to 3 first order ODEs. Also due to +-1, you have two systems of ODEs. Try following code...

3 years 前 | 0

| 已接受

已回答
using fzero with arrayfun searching for zeros inside an interval
Create a cell array and then use cellfun() f = @(x) -x.^2+4; C = {[-3 1.9]; [1.95 3]}; sol = cellfun(@(x) fzero(f, x), C)

3 years 前 | 1

| 已接受

已回答
2D colormap of a polar coordinates function
You will need to use x = -2:0.02:2; [x,y] = meshgrid(x); a1 = 5; r2 = x.^2+y.^2; I = a1 * exp(-5*r2); surf(x,y,I); shad...

3 years 前 | 2

| 已接受

已回答
How can i get the index of all matrix value
Are you looking for something like this A; B = repmat((1:size(A,1)).', 1, size(A,2))

3 years 前 | 0

| 已接受

已回答
Plot transfer function with exponential function
An alternative approach: s = tf('s'); G = 4*exp(-s)/(s^2+4*s+4); step(G)

3 years 前 | 2

已回答
determine the values of 2 unknowns through nonlinear regression and predict value of equation
There are several ways to do nonlinear regression for a given model in MATLAB. If you have the optimization toolbox, then you ca...

3 years 前 | 0

| 已接受

已回答
How to plot function with conditions (3d)
You can replace the unwanted values with nan. [x,y] = meshgrid (-2:2:2); z = x.*y; mask = x + y <= 1; z(~mask) = nan; surf...

3 years 前 | 0

| 已接受

已回答
I'm trying to plot differential equations but it's showing errors.
You are not applying the initial condition with solving the ode. Check the following code clc close all syms i(t) di = diff(...

3 years 前 | 0

已回答
How could I plot a 3D surface response for 3 independent variables and one dependent variable
First, you need to convert your list of scattered points into a 3D grid using interpolation: https://www.mathworks.com/help/matl...

3 years 前 | 0

已回答
Curve fit or spline fit for a wavy function
Use interp1(): https://www.mathworks.com/help/matlab/ref/interp1.html with 'spline' interpolation method.

3 years 前 | 0

已回答
fitlm works but polyfit does not work
There is probably NaN somewhere in your dataset. fitlm() ignores those data values. For example x = linspace(0, 1, 10); y = 2*...

3 years 前 | 0

| 已接受

已回答
matrix for simulating 20 coin tosses
Try this M = randi([0 1], 20, 1000); M_sum = sum(M); freq = accumarray(M_sum(:), 1, [20 1]); bar(1:20, freq) xlabel('Numb...

3 years 前 | 0

| 已接受

已回答
how to read images from matlab? matlab image processing
You can write a for-loop and save all the images in a cell array P = 'C:\Users\sy\Desktop\miasdbv1.21\MIASDBv1.21'; D = dir(fu...

3 years 前 | 1

已回答
how can I convert comma with semicolan and then again point with comma for a multiple csv files?
Try this str = fileread('scope_0.csv'); str = replace(str, {',', '.'}, {';', ','}); f = fopen('outfile.csv', 'wt'); fprintf(...

3 years 前 | 0

| 已接受

已回答
Convert a value into a Matlab syntax string
You can do something like this exStruct.value = [1 0 0;0 1 0;0 0 1]; out = ['[' strjoin(compose(repmat(' %d ',1,3), exStruct.v...

3 years 前 | 1

| 已接受

已回答
How can I remove successive repeated numbers (column wise) from a matrix?
Easy peasy A = [11 35 57 45 94; 26 45 69 45 86; 58 45 39 96 35; 87 59 64 56 45] B = A(:); or B = reshape(A...

3 years 前 | 0

| 已接受

已回答
Find a transfer function from plot data
The easiet option is to use the system identification app: https://www.mathworks.com/help/ident/ug/working-with-the-system-ident...

3 years 前 | 0

已回答
Indexing between two lists
It seems that you can just use round() on the 3rd column, but since that solution is so obvious, there might be some other reaso...

3 years 前 | 0

| 已接受

已回答
Error using symengine, Either base or exponent must be a scalar.
You are overwriting x and y inside the for-loop. The syntax for vpsaolve() is also incorrect. syms x y r = [3, 3.5, 4, 4.5, 5...

3 years 前 | 1

| 已接受

已回答
Matlab ode solver - putting condition in function
The easiest option might be to do this after getting the solution from ode23s. For example [t, y] = ode23s(..) idx = find(y<...

3 years 前 | 0

| 已接受

已回答
capture a snapshot and saving it to a matrix variable
Are you using it inside App designer? Remove the line clear all; clc; close all

3 years 前 | 1

已回答
How can I transform a transfer function to a filter?
Filtering through a transfer function is equivalent to simulating the dynamic control system with an unfiltered signal at the in...

3 years 前 | 1

| 已接受

已回答
Error using readcell ...Input must be a row vector of characters or string scalar.
This error is thrown inside the try-catch block. So we can't see what is causing the error, but the most common reason is that y...

3 years 前 | 0

已回答
Please how to calculate the number of 1 and 0 in each position in a binary vector
Try this str = '00000001111000000000111111100000000000000011111111'; x = diff([0 find(diff(str-'0')) numel(str)]) Result >> ...

3 years 前 | 0

| 已接受

已回答
Writing differential equation for plot
Try this syms x(t) d1x = diff(x); d2x = diff(x,2); ode = d2x == -sign(x + d1x); cond = [x(0)==1 d1x(0)==0] sol = dsolve(...

3 years 前 | 0

| 已接受

已回答
How to store values of rows in a matrix where the 3rd column is a multiple of 100?
Use can use rem() to filter the rows where the third column is multiple of 100 and then use logical indexing M; % nx3 matrix i...

3 years 前 | 2

| 已接受

加载更多