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

4年弱 前 | 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...

4年弱 前 | 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;...

4年弱 前 | 1

| 採用済み

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

4年弱 前 | 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...

4年弱 前 | 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)

4年弱 前 | 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...

4年弱 前 | 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))

4年弱 前 | 0

| 採用済み

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

4年弱 前 | 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...

4年弱 前 | 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...

4年弱 前 | 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(...

4年弱 前 | 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...

4年弱 前 | 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.

4年弱 前 | 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*...

4年弱 前 | 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...

4年弱 前 | 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...

4年弱 前 | 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(...

4年弱 前 | 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...

4年弱 前 | 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...

4年弱 前 | 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...

4年弱 前 | 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...

4年弱 前 | 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...

4年弱 前 | 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<...

4年弱 前 | 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

4年弱 前 | 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...

4年弱 前 | 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...

4年弱 前 | 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 >> ...

4年弱 前 | 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(...

4年弱 前 | 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...

4年弱 前 | 2

| 採用済み

さらに読み込む