Answered

Error when trying to run a function

function [g] = R(a,b,c,d) rou=880; Cd=0.7; Aorifice=1.963495408*(10^(-5)); Vo=7*10^(-5); Beta=1600*(10^5); Ap=(5.026...

Error when trying to run a function

function [g] = R(a,b,c,d) rou=880; Cd=0.7; Aorifice=1.963495408*(10^(-5)); Vo=7*10^(-5); Beta=1600*(10^5); Ap=(5.026...

41 minuti ago | 0

Answered

How iterate inside a excel file and every 21 rows store values in a matrix?

I don't understand your question completely, but, I would put them all in a single matrix. XY=reshape(XY(1:42,1:2),21,[]);

How iterate inside a excel file and every 21 rows store values in a matrix?

I don't understand your question completely, but, I would put them all in a single matrix. XY=reshape(XY(1:42,1:2),21,[]);

circa 2 ore ago | 0

Answered

How do I convert a cell array with different number of values to a matrix

for k=1:length(m) m{k}=[m{k},repmat(nan,1,5-length(m{k}))]; end m=cell2mat(m);

How do I convert a cell array with different number of values to a matrix

for k=1:length(m) m{k}=[m{k},repmat(nan,1,5-length(m{k}))]; end m=cell2mat(m);

circa 2 ore ago | 1

| accepted

Answered

Return Indices for x Smallest/Largest Values in Array

[~,idx]=sort(x); minIdx=idx(1:3);%for minimum 3 maxIdx=idx(end:-1:end-2);%for maximum 3

Return Indices for x Smallest/Largest Values in Array

[~,idx]=sort(x); minIdx=idx(1:3);%for minimum 3 maxIdx=idx(end:-1:end-2);%for maximum 3

circa 2 ore ago | 1

Answered

Function Requests and receives from the user the dimensions of the sampled matrix until a proper value is obtained

I would put your input into a continuous while loop and break the loop when the condition is met. function [m,n]=MatrixDimInput...

Function Requests and receives from the user the dimensions of the sampled matrix until a proper value is obtained

I would put your input into a continuous while loop and break the loop when the condition is met. function [m,n]=MatrixDimInput...

circa 4 ore ago | 0

Answered

Calculate a monthly average from 3-hour data

If you want to simplify slightly, 8 readings * 30 days/month = 240 readings per month ... = 377 months = 90480 readings. Truncat...

Calculate a monthly average from 3-hour data

If you want to simplify slightly, 8 readings * 30 days/month = 240 readings per month ... = 377 months = 90480 readings. Truncat...

circa 5 ore ago | 0

Answered

How can I perform an operation on each element of a vector individually using a for loop?

No loop needed. [a,b]=pol2cart(Zp(:,3),Zp(:,2)); Zp=a+b.*i;

How can I perform an operation on each element of a vector individually using a for loop?

No loop needed. [a,b]=pol2cart(Zp(:,3),Zp(:,2)); Zp=a+b.*i;

circa 5 ore ago | 1

| accepted

Answered

Assign a number of random elements to different variables?

v=randperm(40); k=[]; while isempty(k) a=randi(40,1000,6);%you could change 40 to something smaller if you want to limi...

Assign a number of random elements to different variables?

v=randperm(40); k=[]; while isempty(k) a=randi(40,1000,6);%you could change 40 to something smaller if you want to limi...

circa 6 ore ago | 1

| accepted

Answered

How can I plot the following in MATLAB?

Not sure if this is what you are looking for or not. for n=0:8 f=@(x)exp((1-cos(pi*x))/pi.*cos(n*pi*x)); b(n+1)=2*int...

How can I plot the following in MATLAB?

Not sure if this is what you are looking for or not. for n=0:8 f=@(x)exp((1-cos(pi*x))/pi.*cos(n*pi*x)); b(n+1)=2*int...

1 giorno ago | 0

| accepted

Answered

change the distance between grid lines

Look at the following function: zticks()

change the distance between grid lines

Look at the following function: zticks()

1 giorno ago | 0

Answered

Two vectors to matrix sorted on occurrence

labels=5; hours=6; x=histcounts2(a(:,1),a(:,2),[labels,hours]);

Two vectors to matrix sorted on occurrence

labels=5; hours=6; x=histcounts2(a(:,1),a(:,2),[labels,hours]);

1 giorno ago | 0

Answered

how to get function value?

syms a; b=2; e=0.9; q=1.2; g=2; k=3; d=0.5; f=(q*b*e/a-d*e)/((q^2)*(e^2)/a+2*e*g); df=diff(f); fvals=eval(subs(f,1:10))...

how to get function value?

syms a; b=2; e=0.9; q=1.2; g=2; k=3; d=0.5; f=(q*b*e/a-d*e)/((q^2)*(e^2)/a+2*e*g); df=diff(f); fvals=eval(subs(f,1:10))...

1 giorno ago | 0

Answered

how to calculate a row of number to be calculate in if else statement matlab

units=[0 800.09 364.73 776.42 695.21 698 338.67 498.05 426.35 713.48]; results=zeros(size(units)); results(units>900...

how to calculate a row of number to be calculate in if else statement matlab

units=[0 800.09 364.73 776.42 695.21 698 338.67 498.05 426.35 713.48]; results=zeros(size(units)); results(units>900...

1 giorno ago | 0

| accepted

Answered

How to use if-function for arithmetic properties properly?

If you are trying to comute the ramanujan sum it should be something like this: function s = ramanujanSum(a,n) f=factor(a); s...

How to use if-function for arithmetic properties properly?

If you are trying to comute the ramanujan sum it should be something like this: function s = ramanujanSum(a,n) f=factor(a); s...

1 giorno ago | 0

Submitted

RIPEMD160 Hash

RIPEMD160 Hash of character array input of maximum length 8191

1 giorno ago | 3 downloads |

Submitted

privateKey2bitAddress Generator GUI

Generates both uncompressed and compressed Bitcoin addresses from private key (either WIF or Hexadecimal)

1 giorno ago | 7 downloads |

Answered

How can i solve an equation with vector(s) and if this can be done using conditional statement

n=2.2; m=1.86; p=0.153; Qv=0.980; B=3.200; Rw=0.265; Rt=[4.05; 4.10; 4.22; 4.30; 4.38; 4.54; 4.82; 5.03; 5.23; 5.43; 5.64;...

How can i solve an equation with vector(s) and if this can be done using conditional statement

n=2.2; m=1.86; p=0.153; Qv=0.980; B=3.200; Rw=0.265; Rt=[4.05; 4.10; 4.22; 4.30; 4.38; 4.54; 4.82; 5.03; 5.23; 5.43; 5.64;...

2 giorni ago | 1

Answered

Output standard deviation and Mean

Function call. I would do the printing after the function call returns. But, this should work for you. [s,m]=mean_stdev(); Aft...

Output standard deviation and Mean

Function call. I would do the printing after the function call returns. But, this should work for you. [s,m]=mean_stdev(); Aft...

2 giorni ago | 0

| accepted

Answered

Confusion on Meshgrid and interp2

x = -0.5:0.1:0.5; y = -0.5:0.1:0.5; k = 0.77; [x,y] = meshgrid(x,y); z = k*(x.^2-y.^2); m = [-0.5 0 0.5]; n = [-0.5 -0.25...

Confusion on Meshgrid and interp2

x = -0.5:0.1:0.5; y = -0.5:0.1:0.5; k = 0.77; [x,y] = meshgrid(x,y); z = k*(x.^2-y.^2); m = [-0.5 0 0.5]; n = [-0.5 -0.25...

2 giorni ago | 0

Answered

how to change the pixel value for each of a list of pixels

I(m(:,1),m(:,2),m(:,3))=0;

how to change the pixel value for each of a list of pixels

I(m(:,1),m(:,2),m(:,3))=0;

2 giorni ago | 0

Answered

Leverrier method to find polynomial of matrix

function c = leverrier(A) a=size(A,1); M=zeros(a); c=zeros(1,a+1); c(1)=1; for k=2:a+1 M=A...

Leverrier method to find polynomial of matrix

function c = leverrier(A) a=size(A,1); M=zeros(a); c=zeros(1,a+1); c(1)=1; for k=2:a+1 M=A...

2 giorni ago | 1

| accepted

Answered

How can I obtain my expected result?

function out=picker(c,in1,in2) if c out=in1; else out=in2; end fprintf('out=%d',out);

How can I obtain my expected result?

function out=picker(c,in1,in2) if c out=in1; else out=in2; end fprintf('out=%d',out);

2 giorni ago | 1

Answered

How can I construct all fairs of points?

a=nchoosek([1 2 3],2); b=[a; fliplr(a)];

How can I construct all fairs of points?

a=nchoosek([1 2 3],2); b=[a; fliplr(a)];

2 giorni ago | 0

| accepted

Answered

Reduce Matrix by Adding Every Nth Rows and Nth Columns

m=m(1:20:8000,1:40,4000);

Reduce Matrix by Adding Every Nth Rows and Nth Columns

m=m(1:20:8000,1:40,4000);

2 giorni ago | 0

| accepted

Answered

How to split vector according to conditions?

Not exactly sure what you are trying to do. m=[min(X(V(1:2))),min(X(V(3:5))),min(X(V(6:8)))];

How to split vector according to conditions?

Not exactly sure what you are trying to do. m=[min(X(V(1:2))),min(X(V(3:5))),min(X(V(6:8)))];

2 giorni ago | 0

Answered

Someone can help with the matrix manipulation?

I assume you can use sum. vector=[]; for k=1:size(A,1) for m=1:size(B,1) if sum(B(m,:)==A(k,:))==size(A,2) ...

Someone can help with the matrix manipulation?

I assume you can use sum. vector=[]; for k=1:size(A,1) for m=1:size(B,1) if sum(B(m,:)==A(k,:))==size(A,2) ...

3 giorni ago | 0