Question

Homework 06b For...Next Statements The elements of a Hilbert matrix are given by the formula bu=1/(i+j-1), where į and j are

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

Use below code to update the excel sheet with Hilbert matrix in VBA:

Sub PrintHilbertMatrix()

'

' PrintHilbertMatrix Macro

'

'

Dim m As Integer

Dim denominator As Integer

'take the size of the matrix

m = InputBox("Enter size of the matrix")

'select the excel sheet

Application.Workbooks("Matrix.xlsm").Worksheets("Hilbert").Select

    'loop to print hilbert matrix

    For i = 1 To m

        For j = 1 To m

            Cells(j, i).NumberFormat = "# ???/???" 'to format the cell to show fraction till 3 digits

            denominator = (i + j - 1)

           

            Cells(j, i).Value = 1 / denominator

           

        Next

    Next

End Sub

================================screen shot===============================

Microsoft Visual Basic for Applications - Matrix.xlsm - [Module 1 (Code)] Eile Edit View Insert Format Debug Run Tools Add-In

Output:

Matrix - Excel Abhishek Varshney AV AutoSave Off Hydro File Home Insert Page Layout Formulas Data Review View # ✓ Ruler Ruler

Click on ok.

AutoSave off Havero File Home Insert Page Layout A Ruler Normal Page Break Page Custom ✓ Gridlines Preview Layout Views H For

Please rate answer. Thanks

Add a comment
Know the answer?
Add Answer to:
Homework 06b For...Next Statements The elements of a Hilbert matrix are given by the formula bu=1/(i+j-1),...
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
  • Complete the following four hypotheses, using α = 0.05 for each. The week 5 spreadsheet can...

    Complete the following four hypotheses, using α = 0.05 for each. The week 5 spreadsheet can be used in these analyses. 1. Mean sales per week exceed 42.5 per salesperson 2. Proportion receiving online training is less than 55% 3 Mean calls made among those with no training is at least 145 4. Mean time per call is 14.7 minutes Using the same data set from part A, perform the hypothesis test for each speculation in order to see if...

  • Create three or more MySQL Data Control language (DCL) Statements using the Youth League Database. 1....

    Create three or more MySQL Data Control language (DCL) Statements using the Youth League Database. 1. A Create new user statement for the database 2. A statement that grants privileges to the new user 3. A statement that revokes privileges 1. A SQL Text File containing the SQL commands to create the database, create the table, and insert the sample test data into the table. 2. A SQL Text File containing the DCL SQL Statements. eted hemas Untitled Limit to...

  • kelly Pitney began her censulting busines, kelly Consulting For egete kelly on April 1, 2019. The...

    kelly Pitney began her censulting busines, kelly Consulting For egete kelly on April 1, 2019. The accoenting cycle Consulting a April, includia financial in this chapter. During Hay kelly Consulting entered inato the follew ing transactiens: Statements, was illestrated May 3 Received cash from clents as an aduance payment for services to be preided and recorded t as onearned fees, 4,500 5, Received cash fram clients on account, 2, 450 9 Paid cash for a news paper advertisement, $225 13....

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