Question

what it is the difference between these commands? what command would I use to create an...

what it is the difference between these commands? what command would I use to create an array that spans between 5 and 25 and is equispaced into four intervals?

command 1: x= 5:5:25

command 2: x =linespace(5,25,4)

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

1) x= 5:5:25 will return 5 10 15 20 25

It will create array of number between 5 and 25 at 5 integers apart

2) x =linspace(5,25,4) returns 5.0000 11.6667 18.3333 25.0000

will return 4 numbers between 5 and 25 which are equidistant

If you want 4 intervals you have to use  x= 5:5:25

The four intervals are (5,10), (10,15), (15,20), (20,25)

Add a comment
Know the answer?
Add Answer to:
what it is the difference between these commands? what command would I use to create an...
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
  • Please write the Linux commands and run them. h. What is the command or commands that...

    Please write the Linux commands and run them. h. What is the command or commands that would list the contents of the /var/log directory in alphanumeric order? List the command and its output. i. What is the command or commands used to list the files in /var/log in order of their size? List the command and its output. j. What is the command or commands used to list the top 10 file who use the most disk space? What is...

  • For each command give me the ENTIRE COMMAND SEQUENCE. If I ask you 'What command would...

    For each command give me the ENTIRE COMMAND SEQUENCE. If I ask you 'What command would I use to move the file one.txt to the parent directory and rename it to two.txt?", the answer is NOT 'mv'. That is only part of the command. 16. What command could I run to determine whether the ssh daemon is listening? With OpenSSH installed and running, the result should show that ssh/port 22 as "listening.' (5 pts) 17. Create a crontab entry that...

  • What are the exact commands I should use to complete the task? 1. Run command (date;...

    What are the exact commands I should use to complete the task? 1. Run command (date; sleep 45; echo “Done.”; date) > date.out in the foreground (i.e. without &) 2. Suspend it with Ctrl-Z. Pay attention to the number in the [], it will become handy later. This number is the job number of the command that has been suspended. 3. Run command top to display only processes started by you (i.e. associated with your userid). Write down the process...

  • 1 What is a difference between override and new when it comes to inheritance? 2 What...

    1 What is a difference between override and new when it comes to inheritance? 2 What is the difference between List<type> and ArrayList? AND Which one should you use and why? 3. If I have a file test.txt, and have committed it to the git repository using: $ git commit test.txt Then made some changes, what command (or option) do you use to get the original file back (ie restore the contents of the committed file)? 4 What command (or...

  • 1.Which of the following Linux scripting commands would be used to access the single command-line parameter...

    1.Which of the following Linux scripting commands would be used to access the single command-line parameter that a user has typed on the command-line? Group of answer choices A) $0 B) $# C) $$ D) $* E) $1 2. If I type the command “update my local Internet settings” (without the quotes) at the Linux command-line, from within the running script which of the following variables would the word “Internet” be stored in, if the script gets run correctly? Group...

  • All commands must be in the command line. The expense data file is separate. Programming Project...

    All commands must be in the command line. The expense data file is separate. Programming Project #2: Manage Spending Using Commands Objectives: • Understand how to create and manipulate list of objects using array or vector class • Handle input errors and invalid values • Design and create a well-structure program using C++ basic programming constructs and classes. Description: Each “expense” contains 2 values: the spending amount (double) and its description (string) Here is an example of the “expense” data...

  • 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. ******* ** **** *** ***** ******* ***** ***

  • For the following array in the image below, create the MATLAB command that would generate it...

    For the following array in the image below, create the MATLAB command that would generate it and store it into a variable with a name such as 'pi'? 11 11 111] 2 22 222 13 33 333)

  • What is the Rcode and result in Rstudio 3. What is the difference between a vector...

    What is the Rcode and result in Rstudio 3. What is the difference between a vector and a list in R? What about the difference between a matrix and a dataframe in R? Without using R, provide the output from the following command in R: 16; d = array(c, dim = c(2,4, 2))an,2, 5. Explain the connection between z and y, where = qnorm(5); y = pnorm (0

  • What would be the results of the following code? Create array1 ← [33, 88, 11, 44,...

    What would be the results of the following code? Create array1 ← [33, 88, 11, 44, 99, 55] value ← array1[0] FOR each value in array1 IF(array1[i] < value) THEN value ← array1[i] ENDIF ENDFOR Question 7 options: A) Value contains the lowest value in array1. B) Value contains the highest value in array1. C) Value contains the sum of all the values in array1. D) Value contains the average of the values in array1. Question 8 (1 point) What...

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