Community Profile

# susan sara

Active since 2022

Spoken Languages:
English

#### Content Feed

View by

Question

Error "Supplied objective function must return a scalar value."
Hi,I am trying to minimize a function,but shows an error, clc; clear; gb=3;gs=8; G=[10;10;10;20;30;30;30]; Gh=[30;30;...

2 months ago | 1 answer | 0

### 1

Question

How to plot 3D suraface and contour lines?
I want to plot the function X0=[0;0]; lb=[-10;10]; ub=[-10;10]; f=@(x)(2*x(1)+20/x(1)+2*x(2)+20/x(2)+120); x=fmincon(f,X0,[...

2 months ago | 1 answer | 0

### 1

Question

How to correct the code?
In this code I optimize the objective function using fmincon.But I didnt get the correct output clc; clear all; gr=3;gs=8; ...

3 months ago | 1 answer | 0

### 1

Question

How to optimize an objective function with repect to two variables using fmincon?
I want to maximize this objective function with respect to a and b using fmincon. max(-90a-90b+540) subjected to 3<=a ; b<=8

3 months ago | 1 answer | 0

### 1

Question

How to correct the error in code?
clc; clear all; a1=3;b1=8; G=[0;1.5;2;3.5;4;4.5;4.5]; L=[3.0;2.5;3.5;3.5;3.2;4.2;4.0]; H=[40;40;40;20;20;20;20]; ...

3 months ago | 1 answer | 0

### 1

Question

Error ' Index in position 2 exceeds array bounds'.how to correct this.
When run it, shows "Index in position 2 exceeds array bounds. Index must not exceed 2. Error in practice (line 20) while(a...

4 months ago | 1 answer | 0