Feeds
질문
How to exit an optimization function without error?
I am using fsolve at two stages: first it finds the solution for problem A, and this solution is then used to solve problem B. ...
대략 1년 전 | 답변 수: 1 | 0
1
답변질문
Single iteration with lsqnonlin (or fsolve), only compute new X0
I want lsqnonlin (or fsolve) to only carry out one iteration, ie. compute the new X, and then stop. No further function evaluati...
1년 초과 전 | 답변 수: 1 | 0
1
답변답변 있음
plot the bifurcation into multiple colors on mathematical modelling case
I dont have time to look into your code, but I usually plot bifurcations using "contour". I compute the eigenvalues, and then de...
plot the bifurcation into multiple colors on mathematical modelling case
I dont have time to look into your code, but I usually plot bifurcations using "contour". I compute the eigenvalues, and then de...
거의 2년 전 | 0
| 수락됨
답변 있음
How to sequentially generate a vector from loop?
It's not clear what exaclty is your problem. But maybe something like this can help you: s=2 for k=1:7 A_{k} = A(1:k); i...
How to sequentially generate a vector from loop?
It's not clear what exaclty is your problem. But maybe something like this can help you: s=2 for k=1:7 A_{k} = A(1:k); i...
거의 2년 전 | 0
답변 있음
how can I write this in a compact form? can anyone suggest a single line code for it
You can do something like: A=[zeros(1,10);eye(9),zeros(9,1)]+ .... Try to figure out the details yourself...
how can I write this in a compact form? can anyone suggest a single line code for it
You can do something like: A=[zeros(1,10);eye(9),zeros(9,1)]+ .... Try to figure out the details yourself...
거의 2년 전 | 0
답변 있음
write the next column of one array to the previous column of another array
One problem in your current code is that you are overwriting I(:,k,b) for every l. so you might as well use: for l=L1 (inste...
write the next column of one array to the previous column of another array
One problem in your current code is that you are overwriting I(:,k,b) for every l. so you might as well use: for l=L1 (inste...
거의 2년 전 | 0
질문
Scaling in optimization problems
Assume a simple example, with an optimization problem:max subject to , with and given. I want to solve it with fmincon (becau...
거의 2년 전 | 답변 수: 1 | 0
1
답변질문
Multivariate quadrature (approximation of joint distribution for portfolio choice)
I would like to numerically compute an optimal portfolio, using multiple assets, which are correlated. So my question is: Is t...
대략 2년 전 | 답변 수: 0 | 0
0
답변질문
Workflow Matlab with Git
I am new to Git. I mainly use Git to publish releases of Matlab packages. The packages consists of a core with some functions an...
거의 3년 전 | 답변 수: 1 | 0
1
답변답변 있음
can someone provide me alternative code for this? It shows U and v must be of same size. I am new to Matlab
I think quiver and quiver3 only work with numerical data. So you to get numercial values for P, Q, R. I think you can use the fu...
can someone provide me alternative code for this? It shows U and v must be of same size. I am new to Matlab
I think quiver and quiver3 only work with numerical data. So you to get numercial values for P, Q, R. I think you can use the fu...
거의 3년 전 | 0
답변 있음
how to copy specific columns of a matrix to a table
It is not clear what format EDPT has. And also the variable tt3 will be assigned a different value during each loop. If you want...
how to copy specific columns of a matrix to a table
It is not clear what format EDPT has. And also the variable tt3 will be assigned a different value during each loop. If you want...
거의 3년 전 | 0
답변 있음
Change or update an existing variable at iteration intervals in an iteration loop
it==[10 15 25 40] gives a vector as output. You want a scalar either 0 or 1: Use: ismember(it,[10 15 25 40])
Change or update an existing variable at iteration intervals in an iteration loop
it==[10 15 25 40] gives a vector as output. You want a scalar either 0 or 1: Use: ismember(it,[10 15 25 40])
거의 3년 전 | 1
| 수락됨
답변 있음
Need help with my code
You need to use a equation solver. I assume it is a non-linear problem, so then use fminsearch or fsolve (or lsqnonlin if you wa...
Need help with my code
You need to use a equation solver. I assume it is a non-linear problem, so then use fminsearch or fsolve (or lsqnonlin if you wa...
거의 3년 전 | 0
| 수락됨
답변 있음
Cycle counter with reset
you can use the function mod. For example: if mod(n,5) == 0 or variants thereof.
Cycle counter with reset
you can use the function mod. For example: if mod(n,5) == 0 or variants thereof.
거의 3년 전 | 0
| 수락됨
답변 있음
Add x=y line to the scatter plot
x = linspace(300,600,2); y = x; plot(x,y) And you will need a hold command after the scatter command.
Add x=y line to the scatter plot
x = linspace(300,600,2); y = x; plot(x,y) And you will need a hold command after the scatter command.
대략 3년 전 | 0
답변 있음
Find the difference between two numbers in an array and create a new array
d_theta=diff(theta);
Find the difference between two numbers in an array and create a new array
d_theta=diff(theta);
대략 3년 전 | 0
| 수락됨
답변 있음
Discretise a domain into a grid of uniform volume size
Why is linspace not helpful? x1 = linspace(0,1,M); x2 = linspace(0,1,M); [X1,X2] = ndgrid(x1,x2);
Discretise a domain into a grid of uniform volume size
Why is linspace not helpful? x1 = linspace(0,1,M); x2 = linspace(0,1,M); [X1,X2] = ndgrid(x1,x2);
대략 3년 전 | 0
질문
Scientific description of cubic spline (interpolation)
Dear all, I am writing a scientific article (quantitative economics), and I need to describe the 'spline' method (cubic spline ...
대략 3년 전 | 답변 수: 0 | 1
0
답변답변 있음
how can i save the even index to a matrix 2:5 using for loop
I think you want something like this: (which you could speed up by pre-allocating MAT=NaN(2,5)) cnt_rows = 0; cnt_cols = 0;...
how can i save the even index to a matrix 2:5 using for loop
I think you want something like this: (which you could speed up by pre-allocating MAT=NaN(2,5)) cnt_rows = 0; cnt_cols = 0;...
대략 3년 전 | 1
질문
mldivide versus least squares: X\(eye(m)) versus ( (X'X)\eye(m))*X'
Dear all, I am fitting a polynomial to data. I construct a polynomial basis X. I use some algorithm to update Y. I could use t...
대략 3년 전 | 답변 수: 1 | 0
1
답변답변 있음
Please help me convert equation to matlab code
[0 0 0;1 2 3] is an example of a matrix i Matlab. Please try the rest yourself. We are not here to do your homework. If you gav...
Please help me convert equation to matlab code
[0 0 0;1 2 3] is an example of a matrix i Matlab. Please try the rest yourself. We are not here to do your homework. If you gav...
대략 3년 전 | 0
답변 있음
Error in fmincon (line 568) initVals.f = feval(funfcn{3},X,varargin{:})
As the error says there is no function P_model_main. You also only provided coded with a function called P_model. And please don...
Error in fmincon (line 568) initVals.f = feval(funfcn{3},X,varargin{:})
As the error says there is no function P_model_main. You also only provided coded with a function called P_model. And please don...
대략 3년 전 | 2
답변 있음
Changing color of plot
The problem is that you plot only 1 point at a time. So there is no line to plot, just a point. That's why your code doesn't wor...
Changing color of plot
The problem is that you plot only 1 point at a time. So there is no line to plot, just a point. That's why your code doesn't wor...
대략 3년 전 | 0
답변 있음
How to evaluate parameters in sum() of handle functions with fminsearch
Take a look at this. I hope it helps. x_exp=rand(1,10); %just to define the known vectors y_exp=rand(1,10); n=3; g=rand(1,n)...
How to evaluate parameters in sum() of handle functions with fminsearch
Take a look at this. I hope it helps. x_exp=rand(1,10); %just to define the known vectors y_exp=rand(1,10); n=3; g=rand(1,n)...
대략 3년 전 | 1
| 수락됨
답변 있음
Plot the slope of a parabola with only the data points being known
clc; clear all; close all; x = linspace(-0.5,0.5,25); %length in (meters) def_3mm_no_grav = -[0.00 5.82e-1 1.08 1.53 1.94 ...
Plot the slope of a parabola with only the data points being known
clc; clear all; close all; x = linspace(-0.5,0.5,25); %length in (meters) def_3mm_no_grav = -[0.00 5.82e-1 1.08 1.53 1.94 ...
대략 3년 전 | 0
답변 있음
How do I plot if I have a lot of data on the x-axis and I want to see the whole line properly in app designer?
It is not clear what you mean with "How can I see all the lines correctly?" I'm sure the lines are correct, but your input is n...
How do I plot if I have a lot of data on the x-axis and I want to see the whole line properly in app designer?
It is not clear what you mean with "How can I see all the lines correctly?" I'm sure the lines are correct, but your input is n...
대략 3년 전 | 0
답변 있음
I can't figure out how to define X in a piecewise function to create a Bending Moment Diagram
The script of your professor is actually the function. Save it and you can call the function. function handle: myfun = @(x)mom...
I can't figure out how to define X in a piecewise function to create a Bending Moment Diagram
The script of your professor is actually the function. Save it and you can call the function. function handle: myfun = @(x)mom...
대략 3년 전 | 1
답변 있음
fsolve, fmincon producing different results
I believe fmincon could also be stuck in a local minimum, due to the quadratic terms. This solution might not actually solve the...
fsolve, fmincon producing different results
I believe fmincon could also be stuck in a local minimum, due to the quadratic terms. This solution might not actually solve the...
대략 3년 전 | 0
답변 있음
how to retrieve a table from a cell array?
NEver used table but i think this will work: X = results{1,2}{1,1}; MyDates = X.Date; Might even work directly: MyDates = ...
how to retrieve a table from a cell array?
NEver used table but i think this will work: X = results{1,2}{1,1}; MyDates = X.Date; Might even work directly: MyDates = ...
대략 3년 전 | 0