Answered
nan in if statement
if ~a||isnan(a)

5 years ago | 3

Answered
Creating an algorithm for a Simultaneous Equation
k=3000*(.2).^(0:10);%however long you want for j=1:length(k) A=[k(j) 1000;240 5]; b=[35000;1665]; out(j,:)=A\b; end

5 years ago | 0

| accepted

Answered
Cody Problem 14. Find the numeric mean of the prime numbers in a matrix.
Input is not a string. function out = meanOfPrimes(in) [a,b]=size(in) sum = 0; c=0; for i = 1:a for j = 1:b i...

5 years ago | 0

| accepted

Answered
Plotting graph from the values of a 15x3 matrix
figure; hold on; for k=[30 40 50 60] plot(m(m(:,2)==k,1),m(m(:,2)==k,3));%m beig your maxtix end

5 years ago | 0

| accepted

Answered
How to add previous iteration of for loop to current iteration
You are overriding your data in each iteration of the loop. You need to index your output. Fs=10000; Ts=1/Fs; t=0:Ts:10; f...

5 years ago | 1

| accepted

Answered
Script to generate a number and show if it is even or odd
number = randi(1000);%use must generate the number first before using it myrem = rem(number,2); %my = myrem; no need for this ...

5 years ago | 1

| accepted

Answered
Using randsample to randomize rows
You could run a loop however many times you want to generate the sampling and then make sure they are all different. y=zeros(1e...

5 years ago | 0

| accepted

Solved


Construct a prime circle
A <https://mathworld.wolfram.com/PrimeCircle.html prime circle> is a circular arrangement of the numbers 1 to 2n such that pairs...

5 years ago

Answered
How to use FOR loops in Matlab ?
Look at the sum() function and element-wise operations. No loop is needed. I provided the numerator as an example. sum((-1).^(1...

5 years ago | 0

| accepted

Solved


Number Puzzle - 104

5 years ago

Solved


Number Puzzle - 103

5 years ago

Solved


Number Puzzle - 102

5 years ago

Solved


Compute the nth Pythagorean prime
Pythagorean primes have the form p = 4n+1, where n is an integer, and they can be written as the sum of squares of two integers....

5 years ago

Solved


Find jumping medalists

5 years ago

Solved


Identify full reptend primes

5 years ago

Solved


Play PRIMEGAME

5 years ago

Solved


Identify prime words

5 years ago

Answered
Find elevments in 400 x 6 matrix, A, using index matrix B, 400 x 1
C=diag(A(:,B))';

5 years ago | 0

| accepted

Answered
Hi i need some help here to put this into a matlab
i=0; while err<tol xnew{i+1}=a+[h,h*2*(1:2^i-1)];%index into cell array (much better than different variable names) h=h/2; ...

5 years ago | 0

Answered
I'm writing a program for calculating the balance of a loan for each month and total interest paid, but I can't get the total interest paid to display
Principle = input('Tell me the full amount of your original loan: ');%changed to Principle Rate = input('Tell me the annual int...

5 years ago | 0

| accepted

Load more