Community Profile


Ahmed J. Abougarair

Last seen: 4 months ago

University of Tripoli

4 total contributions since 2020


Ahmed J. Abougarair's Badges

  • Revival Level 1
  • First Answer

View details...

Contributions in
View by

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) k =length(v); if k==n summa = sum(sum(v)); index =1; return elseif k<n ...

4 months ago | 0

if-statement with conditions.
function out = picker(condition,int1,int2) y=logical(condition) if y==1 out = int1; else out = int2; end ...

4 months ago | 1