Answered
Boundary Value Problem with non boundary values
Yes, BVP4C can solve multi-point conditions also. See: doc bvp4c https://www.mathworks.com/help/matlab/ref/bvp4c.html#mw_1119c...

5 years ago | 0

| accepted

Answered
How to find error in Runge Kutta 4th Order
You did not mention, which problems occur. So before the problem can be solved, the readers have to guess, what the problem is. ...

5 years ago | 1

Answered
writing second degree ODE
In your first code, (F-(Cd*rho*A*0.5*Y2.^2))/m is the 3rd derivative of the position. From a physical point of view, this value ...

5 years ago | 1

| accepted

Answered
How to create multiple strings
Do not create variables dynamically using eval . See: TUTORIAL: How and why to avoid Eval Hiding indices in the names of variab...

5 years ago | 0

| accepted

Answered
Error message using timer
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows...

5 years ago | 0

Answered
System of 2nd order ODE with Euler.
You got it almost. I've fixed a typo and expanded the Euler method to collect the output as matrix. % function main xinit =...

5 years ago | 1

| accepted

Answered
How to create one plot with multiple lines in a for loop?
x = 30:10:100; figure(); % axes('NextPlot', 'add'); % Same as: hold on hold on for k = 1:8 y{k} = rand(size(x)); ...

5 years ago | 1

| accepted

Answered
how can i have a button in one callback function pause the execution of another callback function
% Initialize in the CreateFcn: handles.Pause = false function pushbutton1_Callback(hObject, eventdata, handles) handles.Paus...

5 years ago | 0

| accepted

Answered
Matlab bouncing ball in box
Your point starts at [1,1], but it changes the direction at this strange limits: xl = 2; %.02 xr = 9.65; yb = xl; yt = xr; ...

5 years ago | 1

Answered
Array indices must be positive integers or logical values.
Your V is constant. Then the integral is: function y = Volumen(x) V = 0.001; y = V * 200; end But this does not depend on x...

5 years ago | 0

Answered
Shrink for loop with if conditions
Replace % Normal discount factor VF = zeros(1,numel(Age)); for i = 1:numel(Age) VF(i) = 1/((1+R)^(Age(i))); end ...

5 years ago | 0

| accepted

Answered
Help me write the function please
The vectorized approach with logical indexing: function equation x = linspace(-5, 30, 200); m = (x >= 9); y(m) = 15 *...

5 years ago | 0

Answered
comparison the data and ploting it
function ShowCases(country, names, dailycases) index = any(strcmpi(names, country), 2); % 1st or 2nd column if any(index) ...

5 years ago | 0

Answered
Standalone does not create a .mat file while in the app designer it does
It is a bad idea to add a folder to the current path only to access data files. Include only folders in Matlab's path, which con...

5 years ago | 0

Answered
lsqcurvefit to estimate parameters in ODE45
Modify the line [T,y] = ode45(@(t,y) odefcn, tspan, y0, Opt); to [T,y] = ode45(@(t,y) odefcn(t, y), tspan, y0, Opt); or the ...

5 years ago | 0

| accepted

Answered
Add operation is too slow
It would save time to work with the real sizes instead of providing vl, if you actually need (vl+1)^2. This would save 60 mllion...

5 years ago | 0

| accepted

Answered
Figures change slightly position even with Resize Off after opening 2nd figure
I cannot reproduce the problem in R2018b under Windows. Maybe you have inserted a CreateFcn, which modifies the Position? Chekc ...

5 years ago | 0

Answered
How to duplicate rows while skipping/excluding specific rows?
C = str2double(A(~cellfun('isempty', A))); idx = repmat(1:numel(A), 2, 1); idx(2, C == 1000) = 0; PRN = C(idx(idx ~= 0));

5 years ago | 0

| accepted

Answered
Program to perform a reshape of an array
W = [1 1 1 1 0 1 1 1; ... 0 1 1 1 1 1 0 1; ... 1 0 1 0 1 1 0 1; ... 1 1 0 0 1 1 0 1; ... 1 1 0 0 1 1 0 0...

5 years ago | 0

| accepted

Answered
Can someone help me to explain/understand this code
This code imports a text file and parses its contents. It does not contain any comments, therefore it is not useful for producti...

5 years ago | 0

| accepted

Answered
Why do questdlg & plot suddenly become very slow? Need to wait more than 5 minutes
Try to use the profiler to find out, where the time is spent. I assume there is a problem with the graphics driver. Did you upda...

5 years ago | 0

| accepted

Answered
Remove rows from a cell that contain a matrix
YourCell = YourCell(cellfun('prodofsize', YourCell) == 1) % or: YourCell(cellfun('prodofsize', YourCell) > 1) = [];

5 years ago | 1

| accepted

Answered
Why is "MODAL" not...
This is the documented behavior. See https://www.mathworks.com/help/matlab/ref/errordlg.html#mw_17038304-612a-4b3e-b4d7-2712205d...

5 years ago | 0

Answered
How to write an equation with time dependent parameters in MATLAB?
Start with omitting the brute clearing header: clear all; close all; clc; This is a waste of time. USe functions to keep your wo...

5 years ago | 0

| accepted

Answered
Matlab Interface is either using a bad font or weird language
Maybe this helps: https://www.mathworks.com/matlabcentral/answers/196985-how-do-i-change-the-display-language-of-the-matlab-ui-i...

5 years ago | 0

Answered
How can I get file name from user and pass values to it
After selectedfile = fullfile(path,file_new); the variable selectedFile is a char vector, e.g. 'C:\Temp\myFile.txt'. It has th...

5 years ago | 1

| accepted

Answered
Array idx bug when resizing it
The code shows the expected behavior: xvals = []; for i=1:5 idx = length(xvals)+1; xvals(1,idx) = rand; xvals...

5 years ago | 0

Answered
How to interpolate between two adjacent points of time series data, if the difference between any two consecutive points is greater than 25 by using for loop?
x = [555 554 100 10 36 20 17 5 51 70 101 40 13]; L = numel(x); fs = 4; t = 0:1/fs:(L-1)/fs; ready = false; dt = 0.0...

5 years ago | 1

| accepted

Answered
increase of the expression of the string "taylor"
syms x T = taylor(asinh(x), 'Order', 8) See: doc taylor

5 years ago | 0

Answered
please help me on line 45
The error message means, that the elements of (c*d-n+1):c*d) are either not integers or some elements are <= 0. Use the debugger...

5 years ago | 1

| accepted

Load more