Question

Question 18 1.5 points are Generate a for loop in MATLAB script to assign a proper cost to the variable of unit cost (A) base

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#here iterate until 150 times unit number only how much unit number you want just chage the 150 to desire number

here p range is 150

#source code:

printf("unit_num unit_cost\n");
unit=0;
cost_per_unit=0;
for i=1:150
unit=i;
if(i>=1 && i<=4)
cost_per_unit=16;
elseif(i>=5 && i<=24)
cost_per_unit=14;
elseif(i>=25 && i<=99)
cost_per_unit=12;
elseif(i>99)
cost_per_unit=10;
end
fprintf(" %d\t %d\n",unit,cost_per_unit);
end

i 2 3 4 5 00 printf(unit_num unit cost\n); unit=0; cost_per_unit=0; for i=1:150 unit-i; if(i>=1 && i<=4) cost_per_unit=16;

#output:

unit_num unit_cost 16 16

#if you have any dount or more information needed comment below..i will respond as possible as soon..thanks..

Add a comment
Know the answer?
Add Answer to:
Question 18 1.5 points are Generate a for loop in MATLAB script to assign a proper...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that...

    The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that will receive two function handles from elementary math functions which accept a vector to first sort in ascending order then calculate. The script will display the results in two separate Figure Windows with the function names in the title. Submit: fnfr_plot.m Browse My Computer Attach File QUESTION 4 Generate 1x100 random vector, x in the range of 0<x<100 by using rand. Input 2 elementary...

  • drive formula in terms of variable for Vth,Zth QUESTION 3 Find the Thevenin equivalent with respect...

    drive formula in terms of variable for Vth,Zth QUESTION 3 Find the Thevenin equivalent with respect to the terminals a, b of the circuit shown using node analysis. The voltage-dependent current source G1 depends on the voltage across a and band has a gain of 0.01 Units for R1 R2 L1 Ct are Ohms, H. and F. respectively The linear frequency is 50Hz 1 2 For the same circuit derive a formula for Zth in terms of all of the...

  • Question Completion Status: A manufacturing company is considering two alternative locations for a new facility. The...

    Question Completion Status: A manufacturing company is considering two alternative locations for a new facility. The fixed and variable costs for the two locations are found in the table below. For which volume of business would the two locations be equally attractive? If the company plans on producing 50,000 units, which location would be more attractive? Glen Rose Mesquite Fixed Costs $1,000,000 $1,500,000 Variable Costs ($ per unit) 25 23 Attach File Browse My Computer Browse Content Collection QUESTION 37...

  • Write a Script file ‘run-divisiblity-check·m'. Run a for loop from 1 to 100 with an increment...

    Write a Script file ‘run-divisiblity-check·m'. Run a for loop from 1 to 100 with an increment of 1 and using if-else statement print whether the current number in the loop is divisible by 2, 3 or both or neither rem0 command in MATLAB tells the remainder of a variable when divided by a particular number. For instance, if x-3, rem(x, 2) would return 1 and if x-2, rem(x, 2) would be 0 Do a help on rem() command if you...

  • For this project, each part will be in its oun matlab script. You will be uploading a total 3 m f...

    For this project, each part will be in its oun matlab script. You will be uploading a total 3 m files. Be sure to make your variable names descriptive, and add comments regularly to describe what your code is doing and hou your code aligns with the assignment 1 Iterative Methods: Conjugate Gradient In most software applications, row reduction is rarely used to solve a linear system Ar-b instead, an iterative algorithm like the one presented below is used. 1.1...

  • Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5,...

    Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5, 13.0, 3.2, -1.1, 7.0, 0.5, 3.9, 2.1, 4.1, 6.5 In Tasks 1-8 you are asked to conduct some computations regarding this data. The computation should be carried out manually. All the steps that go into the computation should be presented and explained. (You may use R in order to verify your computation, but not as a substitute for conducting the manual computations.) A Random...

  • Accounting LU 40 Points Toints) 1) Archangel Manufacturing has overhead based on a pere 18 has...

    Accounting LU 40 Points Toints) 1) Archangel Manufacturing has overhead based on a pere 18 has finished production activities for the year 2015. The company allocates manufactu percentage of direct labor costs. The company has provided the following information: Total manufacturing overhead estimated at the beginning of the year Total direct labor costs estimated at the beginning of the year Total direct labor hours estimated at the beginning of the ye bor hours estimated at the beginning of the year...

  • DI Question 2 1.5 pts Which situations allow the client main() in the file my_program.py to access a method name, say f...

    DI Question 2 1.5 pts Which situations allow the client main() in the file my_program.py to access a method name, say func(), alone, as in x-func) without dereferencing it using prepended name like modname.func or x = some object. func () or x-SomeClass.func() O func) is defined in some module, say, "modname.py" and modname is imported into my_program.py using: from modname import func() is an instance method or a class method in a class, say SomeClass, defined in the same...

  • stion Completion Status: QUESTION1 2 points a. Victoria spends $651 per month on rent. IiTher monthly take home pay s $1860, what percent d percent sign does she pay in rent? Be sure to label...

    stion Completion Status: QUESTION1 2 points a. Victoria spends $651 per month on rent. IiTher monthly take home pay s $1860, what percent d percent sign does she pay in rent? Be sure to label your response with a 10 points s QUESTION 2 Match the following conversions A. 1.5c 8.500 bs C. 16 pts D.0.75 Ibs E. 80 or 5 Ibs 12 1 oz 12 oz 025 ton 2 gal 2 points Sae A QUESTION 3 Save and S...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT