Community Profile

# Bryce McCord

Last seen: 3 months ago Active since 2020

#### Content Feed

View by

Question

Add code to have switch repeat if a case is not met
fprintf('Difficulty level: \nEasy: [0, 10] \nMedium: [0, 50] \nHard: [0, 100] \n'); % Print statement outputting different diffi...

4 months ago | 3 answers | 0

### 3

Question

How to eliminate the for loop but end with the same result
A = input('Using brackets, enter a vector: ') for i=1:length(A) if(A(i) > 0) B(i) = A(i).^3; else ...

5 months ago | 1 answer | 0

### 1

Question

How do I rewrite this code to output the same answer without the for loops
A = [1 3 5 7 9]; B = [2 4 6 8 10]; L = min([length(A) length(B)]); C = zeros(1, 2*L); for i=1:L C(2*(i-1)+1) = A(i); C(2*i...

5 months ago | 1 answer | 0

### 1

Question

Building a function that calls on an array and finds its maximum
Can somebody help/ give me an example of a function that would find the maximum of an array. Any help would be appreciated.

2 years ago | 0 answers | 0