Answered

How to represent a set of matrices into a single cell?

I would keep them all in a single matrix and then form matrix E (a*b X 4) where each row would hold the cell information of your...

How to represent a set of matrices into a single cell?

I would keep them all in a single matrix and then form matrix E (a*b X 4) where each row would hold the cell information of your...

8 hours ago | 1

Answered

Calculating Harmonic Average in Matlab Function

What is ky? Why not just perform vectorized? No need to index into k. k can be any length vector and the below will calculate th...

Calculating Harmonic Average in Matlab Function

What is ky? Why not just perform vectorized? No need to index into k. k can be any length vector and the below will calculate th...

1 day ago | 0

Answered

How to calculate the jumper's final distance on this problem?

function dist=BJump(v,theta,rho,s) x=0; g=9.81; c=.72; dt=.000001;%not sure how accurate you need y=v*s...

How to calculate the jumper's final distance on this problem?

function dist=BJump(v,theta,rho,s) x=0; g=9.81; c=.72; dt=.000001;%not sure how accurate you need y=v*s...

2 days ago | 0

| accepted

Answered

Remove array values with multiple occurances from "parent" array

a = [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]; b = [1, 1, 2, 4, 4, 4]; c = a; for i=b c(find(c==i,1))=[]; end

Remove array values with multiple occurances from "parent" array

a = [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]; b = [1, 1, 2, 4, 4, 4]; c = a; for i=b c(find(c==i,1))=[]; end

4 days ago | 0

| accepted

Answered

Sum of a Series, Help!

Not sure exactly what you are asking. x=0:.1:10; for n=1:3 S(n,:)=arrayfun(@(i)sum(repmat(-1,1,n+1).^(0:n)./(2*(0:n)+1).*...

Sum of a Series, Help!

Not sure exactly what you are asking. x=0:.1:10; for n=1:3 S(n,:)=arrayfun(@(i)sum(repmat(-1,1,n+1).^(0:n)./(2*(0:n)+1).*...

4 days ago | 0

Answered

Finding equal values in two matrices and create a new matrix

A1 = importdata('Particles.txt'); A2 = importdata('Fragments.txt'); ID_Particles = A1(:,2); MID_Fragments = A2(:,6); CooPart...

Finding equal values in two matrices and create a new matrix

A1 = importdata('Particles.txt'); A2 = importdata('Fragments.txt'); ID_Particles = A1(:,2); MID_Fragments = A2(:,6); CooPart...

5 days ago | 0

Answered

Bit xor of two binary strings and conversion into decimal

Use java BigInteger import java.math.*; a=BigInteger(str1,2); b=BigInteger(str2,2); c=a.xor(b);%c will be the decimal BigInt...

Bit xor of two binary strings and conversion into decimal

Use java BigInteger import java.math.*; a=BigInteger(str1,2); b=BigInteger(str2,2); c=a.xor(b);%c will be the decimal BigInt...

24 days ago | 0

Answered

Replacing row in matrix with previous row depending on condition

If you have consecutive rows containing -2, you will have to repeat until all the -2 rows have been replaced if that is your goa...

Replacing row in matrix with previous row depending on condition

If you have consecutive rows containing -2, you will have to repeat until all the -2 rows have been replaced if that is your goa...

24 days ago | 1

Answered

How do I replace values in a 400x400 matrix with values of 1x1001 array (r) and then replace all r <= 0.02 with 1 and r>0.02 with 0?

r=.0001:.0001:.1001; k=randi(1001,400);%I assumne you want randomly generated m=r(k); M=zeros(400); M(m<=.02)=1; M(m>.02)=0...

How do I replace values in a 400x400 matrix with values of 1x1001 array (r) and then replace all r <= 0.02 with 1 and r>0.02 with 0?

r=.0001:.0001:.1001; k=randi(1001,400);%I assumne you want randomly generated m=r(k); M=zeros(400); M(m<=.02)=1; M(m>.02)=0...

24 days ago | 0

| accepted

Answered

How to solve Index in position 1 exceeds array bounds (must not exceed 1).

You could always store it as a vector in the size you need it. p0_A_SOEC_INIT_out=p0_A_SOEC_INIT_out*ones(1,size_you_need);

How to solve Index in position 1 exceeds array bounds (must not exceed 1).

You could always store it as a vector in the size you need it. p0_A_SOEC_INIT_out=p0_A_SOEC_INIT_out*ones(1,size_you_need);

24 days ago | 0

| accepted

Answered

Array \ Matrix Output display formating

You could also round(x, 3) and use format shortG format shortG; syms phi M=exp(pi*tand(phi))*(tand(45+phi/2))^2; phi=10:0.5:...

Array \ Matrix Output display formating

You could also round(x, 3) and use format shortG format shortG; syms phi M=exp(pi*tand(phi))*(tand(45+phi/2))^2; phi=10:0.5:...

25 days ago | 1

| accepted

Answered

Extract rows in a Matrix based on column values of another Matrix.

count=1; for k=p a=find(q(:,1)==k);%assume there is only one match if ~isempty(a) newMatrix(count,:)=q(a,:);...

Extract rows in a Matrix based on column values of another Matrix.

count=1; for k=p a=find(q(:,1)==k);%assume there is only one match if ~isempty(a) newMatrix(count,:)=q(a,:);...

25 days ago | 0

Answered

slopes of a graph

Derivative of the data provide the slope. You could fit the data first before taking the derivative. You will have to decide. s...

slopes of a graph

Derivative of the data provide the slope. You could fit the data first before taking the derivative. You will have to decide. s...

25 days ago | 0

Answered

Why doesn´t it stop the loop?

use break instead. You should never try to change the loop variable. break;

Why doesn´t it stop the loop?

use break instead. You should never try to change the loop variable. break;

25 days ago | 1

| accepted

Answered

Reshaping a complex 3D array into 1D, and back

1dwave=3dwave(:)'; recovered_wave=reshape(1dwave,size(3dwave));

Reshaping a complex 3D array into 1D, and back

1dwave=3dwave(:)'; recovered_wave=reshape(1dwave,size(3dwave));

25 days ago | 0

Answered

how to write this

If u and t are just scalar 9*u*(t-2); If u and t are arrays or matrices of the same size 9*u.*(t-2);

how to write this

If u and t are just scalar 9*u*(t-2); If u and t are arrays or matrices of the same size 9*u.*(t-2);

25 days ago | 0

Answered

Double interpolation using lookup tables in matlab

[x,y]=meshgrid(25:5:50,-10:5:15); z=[59 76 91 107 122 137;78 98 116 133 149 164;101 127 148 167 184 197;127 155 177 197 214 227...

Double interpolation using lookup tables in matlab

[x,y]=meshgrid(25:5:50,-10:5:15); z=[59 76 91 107 122 137;78 98 116 133 149 164;101 127 148 167 184 197;127 155 177 197 214 227...

25 days ago | 0

| accepted

Answered

creating a signal without an IF statement

signal(find(fastMA>slowMA & rsi10mins < 65,1):find(fastMA<slowMA & rsi10mins > 35,1)-1) = 1;

creating a signal without an IF statement

signal(find(fastMA>slowMA & rsi10mins < 65,1):find(fastMA<slowMA & rsi10mins > 35,1)-1) = 1;

25 days ago | 0

Answered

using nested loop function to create a matrix

You can watch the 1's being filled in: s=10; H=zeros(s); J=zeros(s); for k=1:s for m=1:s H(k,m)=1;%simple doub...

using nested loop function to create a matrix

You can watch the 1's being filled in: s=10; H=zeros(s); J=zeros(s); for k=1:s for m=1:s H(k,m)=1;%simple doub...

25 days ago | 0

| accepted

Answered

Create Symbolic functions with existing function file

It should work, you just need to pass a symbolic z to the function. It would help in the future if you created code that we coul...

Create Symbolic functions with existing function file

It should work, you just need to pass a symbolic z to the function. It would help in the future if you created code that we coul...

26 days ago | 0

| accepted

Answered

Random display of 1 out of several images

You could read all the images into a cell array (each image in an element), then: for k=1:8 imageCell{k}=imread([num2str(k...

Random display of 1 out of several images

You could read all the images into a cell array (each image in an element), then: for k=1:8 imageCell{k}=imread([num2str(k...

26 days ago | 1

| accepted

Answered

The following error occurred converting from sym to double: Unable to convert expression into double array.

Do you have to perform symbolically? Does not look like the integral exists. Why not numerically? function f= myf2(w,k) dfm =@...

The following error occurred converting from sym to double: Unable to convert expression into double array.

Do you have to perform symbolically? Does not look like the integral exists. Why not numerically? function f= myf2(w,k) dfm =@...

26 days ago | 0

| accepted

Answered

Creating a Bell Curve of Data

Just looking at your data, histogram() function is useful. histogram(tmax01,30);%however many bins you want You could overlay:...

Creating a Bell Curve of Data

Just looking at your data, histogram() function is useful. histogram(tmax01,30);%however many bins you want You could overlay:...

26 days ago | 0

| accepted

Answered

Help with Viewing Table Contents

It is a .m file. All you have to do is: load('FloObsWindTable'); It will be in your work space. Double click on it and navigat...

Help with Viewing Table Contents

It is a .m file. All you have to do is: load('FloObsWindTable'); It will be in your work space. Double click on it and navigat...

26 days ago | 0

| accepted

Answered

Numerical Differentiation that returns column vector

If the time interval is constant (.005 between readings), it should be as simple as: thetadot=diff(theta1inv)/.005; You will g...

Numerical Differentiation that returns column vector

If the time interval is constant (.005 between readings), it should be as simple as: thetadot=diff(theta1inv)/.005; You will g...

26 days ago | 0

Answered

readmatrix is truncating and moving decimal

Are you sure there is not a times 1e5 somewhere before the matrix is displayed. The numbers are likely the same but the format i...

readmatrix is truncating and moving decimal

Are you sure there is not a times 1e5 somewhere before the matrix is displayed. The numbers are likely the same but the format i...

26 days ago | 1

Solved

Basics - not so easy division

Please make a function whcih divides x/y, but pay attention for some exceptions with NaN,0,Inf. Sometimes return "ERROR" instead...

27 days ago

Answered

Root of a complex function

It seens relatively straight forward to solve by brute force. Just keep running while reducing the step size of T until you get ...

Root of a complex function

It seens relatively straight forward to solve by brute force. Just keep running while reducing the step size of T until you get ...

27 days ago | 1

Answered

How to make a trajectory from position and Velocity data

newVariable=[eulerAngles(:,2)';gyr(:,2)'];

How to make a trajectory from position and Velocity data

newVariable=[eulerAngles(:,2)';gyr(:,2)'];

27 days ago | 0

| accepted