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

  Characterizing population of about countries

Select 10 features characterizing the population of about 100 countries. load it into Matlab. Normalize the data between 0 and 1. (min, max and minmax are some useful Matlab commands)

  Kerfuffleboard is a game very much like shuffleboard

Kerfuffleboard is a game very much like Shuffleboard. Players take turns shooting disks at a trianglular scoring area. While the scoring areas are the same in shuffleboard and kerfuffleboard, a disk's contribution to a player's score will be calcu..

  Construct the shear force and bending moment diagrams

Write the algorithm and draw the flowchart for each problem

  Mobile robot control and potential field

Write a MATLAB code to compute forces due to each obstacle and goal. Compute total force on vehicle at point(x,y).

  Create an animation of a square

create an animation of a square according to the directions below. Create a square with a side length of 3 with the square centered at (5,5). Translate this square along a cosine wave on the interval [0, 6*pi].

  Demonstrate the effect of zero-padding

Write a programs in Matlab to demonstrate the effect of zero-padding and filtering the DC-component in the frequency domain.

  Design and explain a computer-based simulation model

Design and explain a computer-based simulation model which you will use to estimate the probability that among 25, 50, 75, 100, 500, or 1000 randomly chosen people, at least 2 people share the same birthday.

  Find the roots using matlab built-in functions roots & fzero

the following equation, what is the modified equation for a fixed-point iteration method. The roots of the function are x = -2.2020235, -0.4088152, and 1.11083871, how would you determine whether or not the method will converge on a root? If the tech..

  Compute the eigenvalues and eigenvectors of the matrix

Compute the eigenvalues and eigenvectors of the matrix

  Design and fir filter in matlab

What does the pole-zero diagram tells you about the filter

  Create a matrix of 5x6

Prepare a matrix of 5x6. with identical columns and rows ranging from 200 to 1000 in equal increments

  Generate a sphere of diameter 3. create 3 vectors

Generate a sphere of diameter 3. Create 3 vectors representing the translation of this sphere along the x, y, and z axes. Generate the correct vectors given the description below: The sphere should be translated to (-10, -10, -10).

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