Question

Write a loop that will take your name (or any other name) and write it vertically,...

Write a loop that will take your name (or any other name) and write it vertically, one character at a

time and place a * at the top and bottom. Assume that the name is stored as a vector of characters.

*

J

A

M

E

S

*

Need help with matlab.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
name = "JAMES";
fprintf("*\n");
for i=1:length(name)
    fprintf("%c\n",name(i));
end
fprintf("*\n");

Output:

phpQyF8qj.png

Add a comment
Know the answer?
Add Answer to:
Write a loop that will take your name (or any other name) and write it vertically,...
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
  • matlab Write a script using a loop that will take a vector (of any size) of...

    matlab Write a script using a loop that will take a vector (of any size) of numbers and remove all numbers that are between 5.0 and 9.0 and assign the remaining vector to a nevw variable. Example: A-[1,5,8,10,13,18.20,9,4,6,8] B-[1,10,13,18,20,4]

  • Sketch the graph For this question, take a piece of paper and write your name and...

    Sketch the graph For this question, take a piece of paper and write your name and the date at the top thand this in to me at the start of our next class, Consider a mass (m-0.5 kg) attached to a spring C- 12.5 N/m). The massis Pulled to i's potive mpoltuce Al ind let go As the mass pas0os e equilibrium point for the first time, you start your timer (ta). Plot a position-time graph for this motion. Hint...

  • Activity: Kirchhoff's Rules Grade (0-6) NAME (print) (sign) Kirchoff's loop rule: the sum of the voltage...

    Activity: Kirchhoff's Rules Grade (0-6) NAME (print) (sign) Kirchoff's loop rule: the sum of the voltage drops around any loop is , 18V zero. Kirchoff's junction rule: the sum of the currents into any junction (node) is zero. 0.52 There are three loops: the top loop (abcdea), the bottom loop (aefgha), and the outside loop (abcdefgha). 2.5 6.012 Top Loop: Write down Kirchhoff's loop rule for the top loop going clockwise from point a. Use symbols not numbers. Careful of...

  • 1.Write exactly one for loop statement that prints this column of nine words: snake frog snake...

    1.Write exactly one for loop statement that prints this column of nine words: snake frog snake frog snake frog snake frog snake Enter your loop statement in the box below. Question 2. 5 points Suppose s is any String. Write a loop that prints s backwards, and with the symbol - (dash), printed twice, between pairs of characters and also at the very end: If s is "horse", your loop should print e--s--r--o--h-- If s is "pig", your loop should...

  • 2) Write a function stringManip that takes in a character string and returns a character string...

    2) Write a function stringManip that takes in a character string and returns a character string following these rules: a) any vowel (a, e, i, o, u) is replaced by the character '&' b) any numeric character has 1 added to it (if it was 9, it becomes O instead) (str2num() is useful here) c) all lowercase characters become uppercase d) replace the final character with '!' e) append the length of the string before this step to the end...

  • HELP NEEDED in C++ (preferred) or any other language Write a simple program where you create...

    HELP NEEDED in C++ (preferred) or any other language Write a simple program where you create an array of single byte characters. Make the array 100 bytes long. In C this would be an array of char. Use pointers and casting to put INTEGER (4 byte) and CHARACTER (1 byte) data into the array and pull it out. Make sure you can access both character and integer data at any location in the array. Read data from a text file....

  • #Write a function called check_formula. The check_formula #function should take as input one parameter, a string....

    #Write a function called check_formula. The check_formula #function should take as input one parameter, a string. It #should return True if the string holds a correctly #formatted arithmetic integer formula according to the rules #below, or False if it does not. # #For this problem, here are the rules that define a #correctly-formatted arithmetic string: # # - The only characters in the string should be digits or the five arithmetic operators: +, -, *, /, and =. Any other...

  • Question 2 (d) Write equivalent code to the one shown below by replacing the while loop...

    Question 2 (d) Write equivalent code to the one shown below by replacing the while loop with a for loop while x <= 15 x=x+1; end [4 marks] (e) Write the small program from the previous question using a single line of code with vector operations. [2 marks] (f) Write a MATLAB script that uses a loop to print the contents of two vectors interleaved in to one vector. Assume both vectors are the same length. For example, if A...

  • Do anyone knows how to write this in java?    You are allowed to use the...

    Do anyone knows how to write this in java?    You are allowed to use the following methods from the Java API: class String length charAt class StringBuilder length charAt append toString class Character any method moveXDownLeft takes a char and a two dimensional array of char as input and returns nothing: The method should find the first occurrence of the char in the array (searching from "top" to "bottom" and "left" to "right"), and it should slide that character...

  • JAVA 6. Create two files and name them: puzzle.txt and puzzle2.txt Inside puzzle.txt, write the following...

    JAVA 6. Create two files and name them: puzzle.txt and puzzle2.txt Inside puzzle.txt, write the following text: MWTaahyiebt_e,c__hnyaoontuc;'e_rste_r_aynr_oert_e_gasoduoipdnp_got_shoeandtl__yty_oot_uhrree__apTdrH_oItgRhrDia_sml__eowtnotere.kr_ss_. Inside puzzle2.txt, write the following text: WTTohhriikssi__niigss,___ttbhhueet___wryrioogunh'gtr__emm_eessshssoaawggieen__gff_rrtoohmme___sswaarmmoppnllgee_22o..nttexxstt Open a file specified by the user. This file will contain a bunch of characters. You should read in each character from the file, one character at a time. Display every third character on the screen. Throw the other characters away. There is a sample input file called puzzle.txt, containing a little message you can...

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
Active Questions
ADVERTISEMENT