Question

Use MATLAB to create a pattern such as the one below in the command window. Prompt the user to enter the max number of column

How do I solve using Matlab?

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

SCREENSHOT OF CODE

1 function draw(cols, ints) 2 for its = 1:ints 3 for i = cols: -1:1 4. for j = 1:1 5 printf(*); 6 7 printf(\n); 8 end end

SAMPLE OUTPUTS

紫米米家米米 客串串串串 津津津 原來事業 家事审 家** 来来来来 客家事本 家出

紫米米家来 紫米米家 ::: 家** 客家事客 家常小家来 康米索出 家常事 家常事 索案事業 来来来来来

CODE TO COPY

function draw(cols, ints)
for its = 1:ints
for i = cols:-1:1
for j = 1:i
printf("*");
end
printf("\n");
end
  
for i = 2:cols
for j = 1:i
printf("*");
end
printf("\n");
end
end
end

draw(5, 2);

PLEASE UP VOTE

Add a comment
Know the answer?
Add Answer to:
How do I solve using Matlab? Use MATLAB to create a pattern such as the one...
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
  • 7) Use MATLAB to create a pattern such as the one below in the command window....

    7) Use MATLAB to create a pattern such as the one below in the command window. Prompt the user to enter the max number of columns and number of intervals ran. In the left figure, the user selected 10 max columns and one interval. In the right figure, the user selected 5 max columns and two intervals. The program should run for n max columns and n number of intervals. ******* ** **** *** ***** ******* ***** ***

  • MATLAB QUESTION 8) Create a program that first prompts the user to enter any two numbers....

    MATLAB QUESTION 8) Create a program that first prompts the user to enter any two numbers. Then prompt the user again to input as many numbers as they choose. Stop the program by inputting-1. Then, display the largest number and second largest number in the command window once the user kills the program. The built-in max function cannot be used. The figure below is an example of what the command window should look like when the code is ran. First...

  • please solve the Program USING MATLAB. do not do #2. write in details for the command...

    please solve the Program USING MATLAB. do not do #2. write in details for the command lines. Make sure the program runs and also completely does what it askes please Write a Matlab program that displays on the screen checkerboard patterns comprising of two alternating_colors to be selected by the user. Your program MUST use as the checkerboard unit pattern a SQUARE INSCRIBED INSIDE A CIRCLE with unit pattern width and checkerboard dimension also to be inputted by the user....

  • Solve it using matlab and there is an example for a similar one i put •...

    Solve it using matlab and there is an example for a similar one i put • Write a function calculate_mean_ci(). The inputs to this function are of the form (x, sigma, level). These are x: a numeric vector. sigma : population standard deviation. level : the confidence level given as a percentage, e.g., 95. • The output is a vector of length two of the form (lwr, upr), where lwr = - 20.025 4 and upr = 1 + 20.025...

  • In Matlab Create a single script (.m file) to solve these problems. Unless directed otherwise, use...

    In Matlab Create a single script (.m file) to solve these problems. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ans to store your results. For this project, suppress your output with semi-colons (;). Each problem should be in a separate cell, using the cell mode feature of MATLAB. Problem 4 Video games are rather complicated to program, not least of which because of the graphics work that needs to be completed...

  • Programming in C: Using a nested for loop create the pattern below. Prompt the user for...

    Programming in C: Using a nested for loop create the pattern below. Prompt the user for the height (number of rows) and width (number of characters per line) for pattern A. You may use any number for height and width, just as long as the basic pattern is preserved. Call a function to print the pattern. This function receives the height and width as inputs (parameters) but does not return a value. Make use of an if structure to instruct...

  • MATLAB Questions. I have a basic understanding of the tools for MATLAB, but do not know...

    MATLAB Questions. I have a basic understanding of the tools for MATLAB, but do not know how to create the code for these questions. Please show the entire code. 2. A paper cup shaped as a frustum of cone with R-14R1 is designed to have a volume of 25 cm Determine R1, R2 and the surface area, S, of the paper for cups with a height, h, of 1O cm. The volume of the cup, V, and the surface area...

  • How do I solve using Matlab? Create a matrix X so that the first row has...

    How do I solve using Matlab? Create a matrix X so that the first row has values from 0 to 50 (default intervals), and the second row has values from 50 to 100. Let matrix Y equal to x10 and Z equal to x + y2 Create 4 subplots containing a mesh, surface, 3-Dimensional, and a surface-contour plot. Label with appropriate titles and labels. The plots should have a string look to them.

  • MATLAB!!! CAN SOMEONE SOLVE THIS PROBLEM ON MATLAB?? THANK YOU PART B: HOUSING LOAN CALCULATOR In this part of the assignment, you are expected to develop a program that calculates housing loan pay-...

    MATLAB!!! CAN SOMEONE SOLVE THIS PROBLEM ON MATLAB?? THANK YOU PART B: HOUSING LOAN CALCULATOR In this part of the assignment, you are expected to develop a program that calculates housing loan pay- ments based on compound interest formulas The program should prompt a user to input the amount borrowed (principal), p, the number of monthly payments, n, and an annual interest rate in R percent. The program should convert the annual interest rate R into a monthly interest rate...

  • create perl script to check all command arguments. Display the argument one by one (use a...

    create perl script to check all command arguments. Display the argument one by one (use a for loop). If there is no argument provided, remind users about the mistake create perl script to create the following directory structure in a directory of user’s choice. The user can supply this input as an argument; if not, prompt the user to enter one from the command line. (User selected existing directory) -->Data -->Image -->Cache

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