Answered
How can I generate voctors of double values from another bector?
v2=[0,v1]; newVector=v2(randi(length(v2),1,m));

10 días ago | 0

Answered
Real solutions to polynomials
Why not just use roots()? a=roots([5 -12 55 -120 124 -48]); r=[]; for k=1:length(a) if isreal(a(k)) r=[r,a(k)]; e...

13 días ago | 0

Answered
Error while performing integration
Or don't even have a Zdirection function x=1:0.1:5; a=5; alpha=30*pi/180; beta=120*pi/180; Z=3; for i=1:length(x) z(i)...

13 días ago | 0

Answered
While Loop, with a user made function
You will need to figure out how you want to compare the maxtrices, less than (<) compares element-to-element producing a logical...

15 días ago | 0

Answered
How do I add to a cell array based on logicals?
There might be an easier way. Here is one with a single loop. b=num2str(B); b=b(b~=' '); [idx1,idx2]=regexp(b,'[0]+'); for k...

15 días ago | 0

| accepted

Answered
How to delete every "n thru m" rows?
I might not understand your question fully. What is the size of your matrix? (260x1) yourMatrix(151:181,:)=[];%deletes rows in ...

15 días ago | 0

Solved


find side of shape

15 días ago

Solved


let y be the inverse of x

15 días ago

Solved


create a matrix [x,y]

15 días ago

Answered
Morse Code Decoder help!
Look at what this does. word='Name'; word=upper(word); morseWord=morse(word-'@');

15 días ago | 0

Answered
write cell array of tables to a .txt file
out=[] for k=1:length(yourCell) out=[out,strjoin(yourCell{k}.Var1,'\t')]; end

15 días ago | 0

| accepted

Answered
Repeat matrix columns in pairs.
out=[repmat(A(:,1:2),1,2),repmat(A(:,3:4),1,2)];

15 días ago | 0

| accepted

Answered
How to find and print elements of a character array?
Use a cell array instead. mem={'ISNT-60','ISA55-55-6 b/b','ISMC-100 b/b','ISMC-125 b/b','ISMB-225','ISMC-175 b/b','ISHB-250','I...

15 días ago | 1

| accepted

Answered
Unable to update while loop condition
Not sure what your question is then. The following works just fine for me. while max(abs(Oij_k1-Oij_k))>tol && (k<Klim)

16 días ago | 0

Answered
Problems replacing for-loops
There is nothing wrong with for-loops. The only thing you can vectorize is T T=0:tmax; for t=1:1:tmax S(t+1)=S(t)+(a-d*S(...

16 días ago | 0

| accepted

Answered
Unable to update while loop condition
Oij_k1=[1 1];%need to define before using while max(abs(Oij_k1-Oij_k))>tol || (k<Klim)%I believe you want >tol

16 días ago | 0

Answered
Index exceeds matrix dimensions error
for j=1:M for i=1:N%changing to N-1 allows script to run q=(-K/2)*(A(i+1,j)-A(i,j)/dr);%A is 105x101 and N=105...

16 días ago | 1

| accepted

Answered
scatter plot (need matlab script)
x=[2.6498, 5.4147, 7.7189, 7.9493, 7.2581, 47.5806, 44.1244, 78.4562, 73.3871, 74.3088, 91.8203, 96.659, 95.9677, 36.9816, 35.13...

16 días ago | 1

Answered
Specific Row/Column addition and subtraction in a N by M matrix
abs(sum(m(2,1:3))+sum(m(3:5,4))-sum(m(3,1:3))-sum(m(4:5,3)));

16 días ago | 0

Answered
Forming a series equation
y=1:100; x=100-10/3*y(2:end);

16 días ago | 0

| accepted

Answered
Please help me with summation
d=3.6e-6;r=.15; n=1:1e6;%not quite infinate eqn=@(t)24/pi^2*sum((1./(n-.5).^2).*exp(-(n-.5).^2*pi^2*d*t/r^2))-12.5; T=fzero(e...

16 días ago | 0

| accepted

Answered
How can I select numbers from excel to matlab?
str=readcell('test.xlsx'); %str={'2019-10-12T02:41:27.091Z,1/0669958925:52238,-5.9858581261e-02,-1.7725070822e-04,+1.1940838453...

17 días ago | 0

Solved


Number Puzzle - 118

17 días ago

Solved


Number Puzzle - 119

17 días ago

Answered
How to fix the range of a variable?
Not clear what the question is, but if you just want to randomly sectect 24 digits from 0-3, then: x=randi(4,1,24)-1;

17 días ago | 0

Answered
How to plot the Free particle wave function
a=10; c1=pi*sqrt(2*a); h=(6.626/(2*pi))*10^-34; m=9.11*10^-31; X=-60:.1:60; t=m*a^2/h; V=zeros(1,201); for j=1:length(X) ...

17 días ago | 0

| accepted

Answered
Use Position Values to Keep Values in Matrix
Filled=Filling.*(cumsum(Volume<0,2)==1);

17 días ago | 0

| accepted

Answered
How to find vector elements indices for the first and last locations of a specific number?
[~,idxfirst]=ismember(unique(A),A); [~,idxlast]=ismember(unique(A),flip(A)); idxlast=length(A)+1-idxlast;

17 días ago | 1

| accepted

Answered
How to fitt a power function to data
If you have the curve fitting toolbox. f=fit(x,y,'power1');

18 días ago | 0

Answered
Return the value from a specific excel colomn/row
If you don't provide an example, we don't know what the format of lat/long/temp is in. They might be numbers or strings. a=read...

18 días ago | 0

Load more