Question
Not enough input arguments error in R line 4
[minvalue , minindex ] = min(v) ; some of ur teams solve it before 20 hr
i need a correct code matlab pls Edit the code to the correct code matlab

program logic: • Find the index of minimum element with min() function. Make sure to take two outputs while using min(), the
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Screenshot

* findsum.mx main.mx 1 v=[12 9 6 10 13]; 2 x=findSum (v)

findSum.m

function x = findSum(v)
[minVal,minIndex]=min(v);
v(minIndex)=mean(v);
x=sum(v);
endfunction

main.m

v=[12 9 6 10 13];
x=findSum(v)

Output

x = 54

Add a comment
Know the answer?
Add Answer to:
Not enough input arguments error in R line 4 [minvalue , minindex ] = min(v) ;...
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
  • Note: I need matlab code and it must be on first entry, output what the question...

    Note: I need matlab code and it must be on first entry, output what the question needs and i need it without any false in the matlab pls program logic: • Find the index of minimum element with min() function. Make sure to take two outputs while using min(), the second output is the location of the minimum element. • replace the element at minimum index with mean(v) • find sum(v) and assign it to output program: function x =...

  • use Python IDEL Problem 4 Fix a program. This program should calculate the matrix addition (C...

    use Python IDEL Problem 4 Fix a program. This program should calculate the matrix addition (C - A+B, where each element of matrix C is equal to the sum of the elements of matrices A and B that have the same indexes cij - aij + bij). However it is incomplete: the range() function arguments, index values of nested lists A, B, and C, and two list statements are missing. Can you find them and fix the program? What is...

  • Thank you!!! 4.1 [2 pts. int rollO Define a function roll() that takes no arguments, and...

    Thank you!!! 4.1 [2 pts. int rollO Define a function roll() that takes no arguments, and returns a random integer from 1 to 6. Before proceeding further, we recommend you write a short main method to test it out and make sure it gives you the right values. Comment this main out after you are satisfied that roll() works. Remenber:texibook Seciion 49 is on randormness, and Chapier 5is on functions. int getKandomNumber return 4 l chosen by fair dice roll....

  • Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture...

    Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture i sent is the first page 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...

  • I need a c++ code please. 32. Program. Write a program that creates an integer constant...

    I need a c++ code please. 32. Program. Write a program that creates an integer constant called SIZE and initialize to the size of the array you will be creating. Use this constant throughout your functions you will implement for the next parts and your main program. Also, in your main program create an integer array called numbers and initialize it with the following values (Please see demo program below): 68, 100, 43, 58, 76, 72, 46, 55, 92, 94,...

  • Use the C programming language to complete #include <stdio.h> #include <stdlib.h> #include <float.h> // Declare Global...

    Use the C programming language to complete #include <stdio.h> #include <stdlib.h> #include <float.h> // Declare Global variables here. void array_stats() { // Insert your solution here. } #include <stdlib.h> #include <time.h> int main() { // Simulate the test setup process. srand( time( NULL ) ); for ( int i = 0; i < 32; i++ ) { val[i] = rand(); } val_count = rand(); val_mean = rand(); val_min = rand(); val_max = rand(); // Call submitted code. array_stats(); // Display...

  • i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due...

    i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due Sunday, 19 May 2019, 11:59 PM Due Friday, 24 May 2019, 11:59 PM Part B: Minimum Submission Requirements Ensure that your Lab4 folder contains the following files (note the capitalization convention): o Diagram.pdf o Lab4. asm O README.txt Commit and push your repository Lab Objective In this lab, you will develop a more detailed understanding of how...

  • C or C++ Project Overview Wild, Wild, West! Dice Game The Wild, Wild, West! is an...

    C or C++ Project Overview Wild, Wild, West! Dice Game The Wild, Wild, West! is an elimination dice game. It can be played by any number of players, but it is ideal to have three or more players. Wild, Wild, West! Requires the use of two dice. At the start of the game, each player receives a paper that will track the number of lives that player has. Each player starts the game with 6 lives. In the first round,...

  • Lab 6 Instructions Objectives: • Executing and experimenting with programs that handle array related topics such...

    Lab 6 Instructions Objectives: • Executing and experimenting with programs that handle array related topics such as declaration, initialization, storing, retrieving, and processing elements. • Effectively manipulating and using ArrayList objects. • Becoming familiar with the use of arrays as method arguments and how array elements are passed to and returned from the called method. • Mastering the use of various debugging tools available on the Eclipse IDU. Important: EVERY one of the following Activities MUST be in a separate...

  • package homework; import java.util.Arrays; import stdlib.*; /** CSC300Homework4 version 1.0 * *    * * Find...

    package homework; import java.util.Arrays; import stdlib.*; /** CSC300Homework4 version 1.0 * *    * * Find the 3 Sections marked TODO: * * TODO #1: SumOddsRecursive * TODO #2: ReverseArray * TODO #3: MergeArrays * * You must not add static variables. You MAY add static functions. * * It is okay to add functions, such as * * <pre> * public static double sumOfOddsHelper (double[] list, int i) { * </pre> * * but it is NOT okay to...

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