Answered

alternative options to prod

output=ones(1,size(input,2)); for j=1:size(input,1) output=input(j,:).*output; end

alternative options to prod

output=ones(1,size(input,2)); for j=1:size(input,1) output=input(j,:).*output; end

2 days ago | 0

| accepted

Answered

generate uniform random numbers between -1 and +1 in matlab

2*rand()-1;

generate uniform random numbers between -1 and +1 in matlab

2*rand()-1;

2 days ago | 0

| accepted

Answered

how to take a row and column of a value and add it to an array

[a,b]=find(A<20); B=A(A<20)+a+b;

how to take a row and column of a value and add it to an array

[a,b]=find(A<20); B=A(A<20)+a+b;

2 days ago | 0

Answered

How can I find a Value with the smallest error in my Matrix?

min(abs(RGB-Tempvalue));

How can I find a Value with the smallest error in my Matrix?

min(abs(RGB-Tempvalue));

5 days ago | 1

| accepted

Solved

Periodic Table II 101.

Given the symbol of an element, return its atomic number. This is the continuation of <http://www.mathworks.com/matlabcentral/co...

6 days ago

Solved

Continued fractions

Find a <http://en.wikipedia.org/wiki/Continued_fraction continued fraction> approximation of x.

6 days ago

Solved

Periodic Table 101.

Given the atomic number (z), answer the symbol for that particular element of the <http://en.wikipedia.org/wiki/Periodic_table/ ...

6 days ago

Solved

Schwarzschild radius

Compute the <http://en.wikipedia.org/wiki/Schwarzschild_radius Schwarzschild radius> for objects of mass m (kg). Use c = 299,792...

6 days ago

Solved

Basic arrays operations.

Apply element-by-element binary operation 'fun' to two arrays (A and B).

6 days ago

Solved

Vectorizing, too easy or too hard?

Please insert a . before any ^, * or / in the string. That's it!!

6 days ago

Solved

ranch area?

Your friend has a ranch with four distinct boundary lines. Three boundary lines are ideal straight roads: (1) North Club Road, (...

6 days ago

Solved

Insert zeros into vector

Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

7 days ago

Answered

Archimedean solids in MATLAB

See appendix A.6: file:///C:/Users/User/Downloads/RovenskiV.ModelingofCurvesandSurfaceswithMATLAB%20(1).pdf

Archimedean solids in MATLAB

See appendix A.6: file:///C:/Users/User/Downloads/RovenskiV.ModelingofCurvesandSurfaceswithMATLAB%20(1).pdf

7 days ago | 0

| accepted

Answered

Summation of Infinity Terms

You need to create a function. The easiest is to use the existing function. It doesn't sound like your instructions prevent this...

Summation of Infinity Terms

You need to create a function. The easiest is to use the existing function. It doesn't sound like your instructions prevent this...

7 days ago | 0

| accepted

Answered

vectorisation a for loop

Although arrayfun is really a loop, c=5; retint=0; dist=log([10:-1:1]+retint); discrim=arrayfun(@(x)1/sum(exp(-c*abs(dist-...

vectorisation a for loop

Although arrayfun is really a loop, c=5; retint=0; dist=log([10:-1:1]+retint); discrim=arrayfun(@(x)1/sum(exp(-c*abs(dist-...

8 days ago | 0

| accepted

Answered

Need help to vectorize a for loop

unimodal=[28 42 46 49 52 55 58 61 64 68 82]; ru=(unimodal-min(unimodal))/(max(unimodal)-min(unimodal)); fu=(0:length(unimodal)...

Need help to vectorize a for loop

unimodal=[28 42 46 49 52 55 58 61 64 68 82]; ru=(unimodal-min(unimodal))/(max(unimodal)-min(unimodal)); fu=(0:length(unimodal)...

8 days ago | 0

| accepted

Answered

How do I plot the variables outside of the for loop for all iterations?

clc; close all; clear; Patm = 18750; Tatm = 216.7; U = 250; R = 287; gamma_air = 1.4; T04 = 1500; Qr = 45000000; B =...

How do I plot the variables outside of the for loop for all iterations?

clc; close all; clear; Patm = 18750; Tatm = 216.7; U = 250; R = 287; gamma_air = 1.4; T04 = 1500; Qr = 45000000; B =...

8 days ago | 0

Answered

How I can choose randomly value from cell?

Why not just, a=cell2mat(SI); b=a(randi(length(a)));%b is a random value inside all of SI

How I can choose randomly value from cell?

Why not just, a=cell2mat(SI); b=a(randi(length(a)));%b is a random value inside all of SI

9 days ago | 0

| accepted

Solved

Outer product of multiple vectors

In tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional arra...

9 days ago

Solved

linear least squares fitting

Inputs: * |f|: cell-array of function handles * |x|: column vector of |x| values * |y|: column vector of |y| values, same l...

9 days ago

Answered

How can I insert the value of a symbol in symbolic matrix and convert it into a numerical matrix?

t=1; subs(GRAM);

How can I insert the value of a symbol in symbolic matrix and convert it into a numerical matrix?

t=1; subs(GRAM);

9 days ago | 0

Answered

Substitution on symbolic function

syms t x0=input('x0= '); x1=input('x1= '); x2=input('x2= '); y=input('input your function of variable t= '); t=x0; fx0=sub...

Substitution on symbolic function

syms t x0=input('x0= '); x1=input('x1= '); x2=input('x2= '); y=input('input your function of variable t= '); t=x0; fx0=sub...

9 days ago | 1

| accepted

Answered

Triangle area with two vectors

function Area = TriVecArea(u,v) Area = .5*norm(cross(u,v)); end

Triangle area with two vectors

function Area = TriVecArea(u,v) Area = .5*norm(cross(u,v)); end

9 days ago | 0

| accepted

Answered

Converting from char to double

This should work for you. A=[40 78]; A=num2str(A); A=str2num(A(A~=' '));

Converting from char to double

This should work for you. A=[40 78]; A=num2str(A); A=str2num(A(A~=' '));

9 days ago | 0

| accepted

Solved

Sum the entries of each column of a matrix which satisfy a logical condition.

Given a numeric matrix A and a logical array L of the same size as A, return a row vector S containing the columnwise sums of th...

10 days ago

Solved

Back to basics 16 - byte order

Covering some basic topics I haven't seen elsewhere on Cody. Switch the byte order of the input (i.e. if little-endian -> big...

10 days ago

Solved

Back to basics 9 - Indexed References

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix and row and column, output the index of th...

10 days ago

Solved

What percentage?

Calculate the output c as the percentage of a on b for given a and b.

10 days ago

Solved

Replace multiples of 5 with NaN

It is required to replace all values in a vector that are multiples of 5 with NaN. Example: input: x = [1 2 5 12 10 7] ...

10 days ago