# how to introduce 2 inputs into a matlab block function that processes only one variable at a time? [closed]

Using SIMULINK, I wanted to optimize 2 variables with the ant colony optimization algorithm; which is written in a matlab function block, the function is of type function y = f (x) it has only one variable to optimize and since I have 2 variables! how can i do ?

• this exact question has been asked before ..... is this a school assignment? – jsotola Dec 16 '18 at 19:22
• But I have not had a answer yet dear jsotola – Student62 Dec 17 '18 at 9:09
• On your other question I told you It's not possible to give you any more help than that because, as @N.Staub mentioned, you haven't linked the package you're using, the function you're using, the error you're getting, or what you're trying to do. I also suggested you write what appears to be costing values into one cost function so you can weight/assign the costs appropriately. Then I said for you to edit your question to include some information so we can help you. – Chuck Dec 17 '18 at 21:40
• I let that question stick around for four days before I deleted it. You never came back to post any follow-up comments, you never made any edits to the question, you didn't say if you were having trouble making a cost function, no mention of the optimizing function/package you're using, what you're trying to do, etc. Please edit your question to provide some relevant information other than "I want to do this thing that I can't do." – Chuck Dec 17 '18 at 21:43
• Thank you @Chuck for your repply : Invalid setting for dimensions of input port of 'vehicle_animation_sim/Demux'. The Demux cannot be used to split matrices Component:Simulink | Category:Model error Error in port widths or dimensions. Output port 1 of 'vehicle_animation_sim/MATLAB Function' is a [5000x7] matrix. – Student62 Dec 17 '18 at 23:47