How to use linprog when i have variable ('A')= cell

1 view (last 30 days)
Hello, I get the following error when i try to run the linprog command : error using linprog (line 144) LINPROG requires the following inputs to be of data type double: 'A'. All the other variables i have are double (f,b,Aeq,beq,lb) except from A which is a 35x1 cell.What can i do in order to convert A to type double.

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 26 Aug 2016
A=cell2mat(A)
  7 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 26 Aug 2016
How do you want to use it with linprog? explain your problem?
Alexandros Samp
Alexandros Samp on 26 Aug 2016
there are 35 nodes in a network and i have to find the optim solution for diameters.I find a range of different diameter for each pipe, each diameter represents a cost.I have an f vector with (1,112) differnt values of costs for pipes , A which is the cell with Headloss for each pipe in a network that is add up ,b is a vector (1,35) with the pressure that is needed in each node , Aeq is the length constraint for each pipe is a matrix (35,112) with zeros and 1, every pipe may be consisted of differnt diameter (example a pipe of 200 m may be x1+ x2+ x3 possible diameters),beq is the length of each pipe and lb is that each x should be greater than zero.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!