Operations Research formulation in MATLAB

9 次查看(过去 30 天)
Solve below Operation Research Program & submit MATLAB code also.
  2 个评论
Steven Lord
Steven Lord 2020-9-16
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
Manthan Hawal
Manthan Hawal 2020-9-17
I tired solving but I am getting this issues and I am having difficulty as I am new to matlab.

请先登录,再进行评论。

回答(1 个)

Steven Lord
Steven Lord 2020-9-17
Looking at the code you posted as a comment I have a couple of observations and suggestions.
The Queen's MATLAB was only an April Fools joke. [It fooled people for longer than I expected it to, though!] The name-value pair to set the Color property of a line when calling plot is 'Color', 'r' (or 'Color', 'g' or 'Color', [1 0.75 0.5] etc.)
plot(1:10, 1:10, 'Color', 'r')
If you look at the documentation page for the plot function there are several pieces of information that may help you. There's a "Name-Value Pair Arguments" section that lists some of the common options like 'Color'. There's also a link in the See Also section at the end of the page to "Line Properties" which shows even more properties you can specify as name-value pair arguments when you call plot (or that you can specify after the line is created.)
At a quick glance, you also have a typo on the line where you define f. You have a comma where you should have a period.
One more note, the decimal separator in MATLAB is period not comma. There is a preference for setting the decimal separator when copying data from MATLAB to the system clipboard, but it has no effect on how data is stored or displayed inside MATLAB. Your meshgrid call confused me until I realized you meant 0,2 to be the double precision number closest to two-tenths. The comma between the 5 and 0 is filling one of its normal roles in MATLAB, separating input arguments being passed to a function.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by