
AYUSH MISHRA
Statistiche
0 Domande
7 Risposte
RANK
16.937
of 284.801
REPUTAZIONE
2
CONTRIBUTI
0 Domande
7 Risposte
ACCETTAZIONE DELLE RISPOSTE
0.00%
VOTI RICEVUTI
1
RANK
of 137.603
CONTRIBUTI
0 Problemi
0 Soluzioni
PUNTEGGIO
0
NUMERO DI BADGE
0
CONTRIBUTI
0 Post
CONTRIBUTI
0 Pubblico Canali
VALUTAZIONE MEDIA
CONTRIBUTI
0 Punti principali
NUMERO MEDIO DI LIKE
Content Feed
Write a function called max_sum that takes v, a row vector of numbers, and n, a positive integer as inputs. The function needs to find the n consecutive elements of v whose sum is the largest possible.
function [summa, index] = max_sum(v,n) if n > length(v) summa = 0; ...
oltre 3 anni fa | 0
Write a function called halfsum that takes as input an at most two-dimensional array A and computes the sum of the elements of A that are in the lower right triangular part of A
function summa=halfsum(A) [m,n]=size(A); summa=0; for i =1:m fprintf('active row :%d \n',i); fo...
oltre 3 anni fa | 0
Write a function called under_age that takes two positive integer scalar arguments: age that represents someone's age, and limit that represents an age limit. The function returns true if the person is younger than the age limit. If the second arg
function too_young =under_age(age,limit) if nargin <2 limit=21; end if age<limit too_young=true; else too_you...
oltre 3 anni fa | 0
Write a function called picker that takes three input arguments called condition, in1 and in2 in this order. The argument condition is a logical. If it is true, the function assigns the value of in1 to the output argument out, otherwise, it assigns
function out=picker(condition,in1,in2) if condition==true out=in1; else out=in2; end SOLUTION : picker(tru...
oltre 3 anni fa | 0
Area of a triangle
function area=tri_area(b,h,n) area=0.5*b*h*n; end %Here b=base of triangle , h=height of triangle , n=number of triangl...
oltre 3 anni fa | 0
Write a function called minimax that takes M, a matrix input argument and returns mmr, a row vector containing the absolute values of the difference between the maximum and minimum valued elements in each row. As a second output argument called mmm,
function [mmr,mmm]=minimax(M) mmr=max(M')-min(M'); mmm=max(max(M'))-min(min(M')); end % here M' is use because when ...
oltre 3 anni fa | 0
Calculate taxi fare by giving multiple inputs and single output
function fare= taxi_fare(d,t) d=ceil(d); %d=total distance cover by taxi t=ceil(t); %t=total time taken to complete...
oltre 3 anni fa | 1