Vb and matlab to calculate the cumulative days

Assignment Help MATLAB Programming
Reference no: EM13165059

Create a function TotalDaysMonth(intYear, intMonth, strIndOrCum) in both VB and Matlab to calculate the cumulative days or number of days in a given month, depending on inputs, by employing array vector in VB or a vector matrix in Matlab.

------------- In VB:

Function TotalDaysMonth(intYear, intMonth, strIndOrCum)

DaysInMonth = Array(31, 28, 31, 30, ...)

. . .

If strIndOrCum = "I" Then

. . .

ElseIf strIndOrCum = "C" Then

. . .

Else

. . .

End If

. . .

End Function

-------------- In Matlab:

Function TotalDays = TotalDaysMonth(intYear, intMonth, strIndOrCum)

DaysInMonth = [31, 28, 31, 30, ...];

. . .

if strIndOrCum == 'I'

. . .

elseif strIndOrCum = 'C'

. . .

else

. . .

end

. . .

end

Note:

1. Matlab: Starting index of a row vector is 1. VB: Starting index of a row vector = 0.

2. You need to call function isLeapYear(intYear) to adjust the output if necessary.

1.2. By having the input as one line of string, combining the year, month, and day; with the expected I/O: (with {xxx} is the input for the prompt)

====================

Enter date: {2012/03/15}

Total day passed in 2012 before 3/15 = 74 days

Reference no: EM13165059

Questions Cloud

Draw an event-graph of a distributed system : Draw an event-graph of a distributed system of three concurrent processes which are communicating messages, and synchronized by their respective logical clocks
Interacting with customers on a regular basis : Social critics have maintained that marketing leads people to buy products they do not want and do not need. However, the failure rate of new products that are heavily marketed is reportedly as high as 80 percent. How can these two seemingly opposite..
Program calculates and displays salesperson''s commission : The sales manager at Tompkins Company wants a program that calculates and displays each salesperson's commission, which is 10% of his or her sales. It also should display the total commission. Use a value-returning function to get the amount sold by ..
Identify the incorrect names or formulas : Identify the incorrect names or formulas.
Vb and matlab to calculate the cumulative days : Create a function TotalDaysMonth(intYear, intMonth, strIndOrCum) in both VB and Matlab to calculate the cumulative days or number of days in a given month, depending on inputs, by employing array vector in VB or a vector matrix in Matlab.
How many moles of oxygen gas were evolved : A test tube containing a mixture of KCl, KClO3, and MnO2 having a total weight of 23.584 g was heated to compose the KClO3. After heating, the mass was found to be 22.347 g.
The program should allow the student : The program should allow the student to enter the answer. If the answer is correct, a message of congratulations should be displayed. If the answer is incorrect, a message showing the correct answer should be displayed.
Prepare a schedule in good form : Prepare a schedule in Good Form that determines Citrine's taxable income for State X purposes and calculate the amount of Federal income tax, if any, for Repair Habitat and for Concrete Pour.  Show your calculation in good form.
Find the mass of sodium required to produce : Find the mass of sodium required to produce 5.68 L of hydrogen gas at STP from the reaction described by the following equation: 2 Na + 2 H2O ® 2 NaOH + H2

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Elementary numerical methods and programming

Project involes determining the dynamics of the double pendulum with a sliding base. Each link is assumed to be of square cross section - MECH 3010: Elementary Numerical Methods and Programming

  Finds the value of a using a numerical method

Finds the value of a using a numerical method

  Write a function in matlab

write a function in MATLAB

  Write a function named ''read_line''

Verify that your code works by saving some text into a file (created in notepad / textedit) and saving the file with extension '.txt'. You should attach the file (call it 'test.txt') with your code.

  Write matlab scripts

Write MATLAB scripts for to accept two numbers from the user; Display all prime numbers between these two numbers.

  Simulate rigid body mechanics

Write a MATLAB code to simulate rigid body mechanics. Create a video file of a free falling rod. Neglect effects from drag or loss of kinetic energy. Make sure the rod falls onto one end showing how the rigid body reacts to hitting the ground. Cannot..

  The body fat percentage

The body fat percentage (BFP) of a person can be estimated by the formula BFP= 1.2xBMI+0.23xAGE -10.8xGEnder-0.54 where BMI is the body mass index, given by BMI = 703 W/H^2, in which W is the weight in pounds and H is the height in inches

  First ten numbers of the sequence of pseudorandom numbers

write a program that gives the first ten numbers of the sequence of pseudorandom numbers

  Explore the design of a recursive digital filter

In this simulation we are going to explore the design of a recursive digital filter which might be usedvin a digital radio station. The sampling frequency used in digital radio (DAB) is either 48 kHz or 24 kHz and for the purposes of this simulation,

  Create a matlab program

Create a MATLAB program that will use MATLAB's fzero function to determine d for the following parameters: R = 0.5 m and in steps of 0.1. Create a table consisting of S and d .

  Matlab code to solve for temperature and pressure variation

Write down the MATLAB code to solve for temperature and pressure variation throughout the expansion process and to evaluate work and heat produced in processes for variable values of n.

  A good way to structure this program

A good way to structure this program is to read in each "number" as a string of characters, look at the first character to determine what kind of number it is (hex, binary, decimal), and then call an appropriate function to convert the string into..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd