回答済み
I need to delete some rows in an array based on if their column values fall inside a range
Hi, to get Matrix B (B contains every row of A that meet all conditions) use: B = A(A(:,1)>xlo & A(:,1)<xhi & A(:,2)>ylo...

7年以上 前 | 0

| 採用済み

回答済み
Solving a system of function handles with fsolve
Hi, use: calc_temp function calc__tenp T = @(T1,T2,T3,T4,T5,T6) [T1 T2 T3 T4 T5 T6]; % unknown variable vect...

7年以上 前 | 1

| 採用済み

回答済み
Help solving 3 ODEs
Hi, try this: syms xA(v) xB(v) xC(v) eqn1 = diff(xA, v) == (0.2*(0.6^2)*((1-(0.375*xA)))*(((5/3)-xA)/(1-0.375*xA)))...

7年以上 前 | 1

| 採用済み

回答済み
User defined function for three scripts
Hi, read about <https://de.mathworks.com/help/matlab/ref/input.html *|input|*> and <https://de.mathworks.com/help/matlab/ref/...

7年以上 前 | 0

| 採用済み

回答済み
Index exceeds the number of array elements (1)
Hi, x(i) will not work - x has size one - because it is your optimization variable - try this instead: % Consta...

7年以上 前 | 1

| 採用済み

回答済み
Finding the adjoint of a Matrix
Hi, the function <https://de.mathworks.com/help/releases/R2017a/symbolic/adjoint.html *|adjoint|*> works on symbolic matrices...

7年以上 前 | 0

| 採用済み

回答済み
Surface Plots on randomly distributed points
Hi, consider the following small example: N = 10; X = rand(N, 1); Y = rand(N, 1); Z = X*Y'; surf(X, Y, Z); ...

7年以上 前 | 0

回答済み
Remove all zeros from a vector (preallocated unused spaces)
Hi, build an example: A=zeros(1,20) A(1:10) = rand() remove zeros: A(A==0) = [] Best regards Stephan

7年以上 前 | 1

回答済み
[Optimization] Optimization of complex models
Hi, since you can not provide any details, only general information can be given. Read the following links and have also a lo...

7年以上 前 | 0

| 採用済み

回答済み
I want to solve a multi point boundary condition differential equation. I keep getting error on my Bvp4c line, I tried debugging it, but could resolve the error.
Hi, there are several Problems in your code: bc=[Tl(1);Tm(21);(1/k)*exp(vx/(2*a))*(Tr(2)(200)+(Tr(1)(200)(v/(2*a))))]; ...

7年以上 前 | 0

回答済み
Why is my code not working?
Hi, You miss to Call your function after you got the inputs. Add this in the third line: v_rotate = my_function(v_orig,a...

7年以上 前 | 0

| 採用済み

回答済み
solve a partial differential equation
Hi, the following code solves the equation with the initial conditions: y(0)=0 dy/dx(0)=0 Then it rewrites the...

7年以上 前 | 0

| 採用済み

回答済み
GA code problem in using options
Hi, this one does create a valid options object on my system: options = optimoptions(@ga,'MaxGenerations',10e5); [...

7年以上 前 | 0

回答済み
What can I do to avoid the error "Index exceeds matrix dimensions " in my simulation for systems of equation?
Hi, gammacAc=0.1128; was missing in parameter declaration and in pars. Try: function Meningitis_Coinfection ...

7年以上 前 | 0

| 採用済み

回答済み
How to set BoundType Conditional to PortfolioCVar Object ?
Hi, check <https://de.mathworks.com/help/finance/portfoliocvar.setbounds.html *|setBounds|*> which is the function to: _Se...

7年以上 前 | 0

| 採用済み

回答済み
How can I set options in lsqnonlin?
Hi, check <https://de.mathworks.com/help/optim/ug/optimoptions.html *|optimoptions|*> - there are also examples and the <http...

7年以上 前 | 1

| 採用済み

回答済み
There is no Cloud Parallel Computing for Home Users ?
Hi, your code is not written in a way that it performs the calculations in parallel - have a look at <https://de.mathworks.co...

7年以上 前 | 0

| 採用済み

回答済み
When I generate a matrix with random numbers with the function rand, which is the order of generation?
Hi, see this: rng(25) a = rand rng(25) b = rand(2,1) rng(25) x = rand(9,1) rng(25) y = rand(3,3) ...

7年以上 前 | 1

| 採用済み

回答済み
Formulation of Optimization Function - MIN (SUM [ (P+X)^2 ])
Hi, i do not know CPLEX - but if i would have to do this with Optimization Toolbox i would use: f_val = @(X)obj_func(X,P...

7年以上 前 | 0

| 採用済み

質問


Matlab crash after accidently assigning a counter variable from a loop as output argument of a function?
Hi, i refer to this <https://de.mathworks.com/matlabcentral/answers/424401-none-of-the-output-variables-are-saved-in-workspac...

7年以上 前 | 2 件の回答 | 0

2

回答

回答済み
None of the output variables are saved in workspace,when running by function, but saves when running without function (by directly assigning input data in script)
Hi, if i assume you want fr, fg and fb as result in workspace change the function declaration to: function [fr, fg, fb] ...

7年以上 前 | 1

| 採用済み

回答済み
I am pretty new to MATLAB. I am try to use ode 45 to solve a differential equation arising from a multiple source boundary condition. I want to use a for loop for the boundary condition, but I guess I am missing something
Hi, maybe it is better to integrate this function stepwise, since your function is not smooth, because of the if-else stateme...

7年以上 前 | 0

回答済み
How to make a multivariable goal optimization
Hi, <https://de.mathworks.com/help/optim/ug/fgoalattain.html *|fgoalattain|*> calculates a result: f(x) <= goal Bett...

7年以上 前 | 0

| 採用済み

回答済み
How to suppress messages/warnings from a script?
Hi, try: options = optimoptions ('fsolve', 'Display', 'none'); result = fsolve (your_input_to_fsolve , options); ...

7年以上 前 | 0

| 採用済み

回答済み
Reformatting one column array into multiple columns
Hi, try: A = [1;2;3;4;5;6;7;8] % rearrange A to 4 columns B = (reshape(A',4,[]))' % get average for every row ...

7年以上 前 | 0

回答済み
Optimization of Artificial Immune system using Genetic algorithm
Hi, solvers like ga only pass only one argument to their objective functions - in your case W. If your function needs additio...

7年以上 前 | 1

| 採用済み

回答済み
How to find multiples of 3 in a vector using a for loop?
Hi, there is no need to use a for loop to achieve what you want. If you want to understand for loops use them, but here is a ...

7年以上 前 | 1

回答済み
Creating discretized grid without values, only text
Hi, if you use R2018b then you can use the new introduced feature <https://de.mathworks.com/help/matlab/ref/xline.html *|xlin...

7年以上 前 | 1

回答済み
solving 4 nonlinear equations with 4 variables
Hi, have a look at <https://de.mathworks.com/help/optim/ug/fsolve.html *|fsolve|*> to solve this numerically. Here is an e...

7年以上 前 | 1

回答済み
Linprog: suppress output message "Optimal solution found"
Hi, try: options = optimoptions('linprog','Display','none'); D=linprog(ones(1,n),-I, (I-W)*I(:,l), [],[],zeros(n,1),opt...

7年以上 前 | 2

| 採用済み

さらに読み込む