Respondida
Create loop with variable pitch
for i=[1 3 5 5.5 6 6.5 7 9] ... end

más de 4 años hace | 0

Respondida
How to paste new values into variables in a matrix
because it is a symbolic object and you need to evaluate it so that we have the new values: syms A B C D M=[A B;C D]; A=1; ...

más de 4 años hace | 0

| aceptada

Respondida
How can I match values using a 'translation array' without looping
solution: dataset = table([1:100]', randi([1,52],100,1), 'VariableNames', ["ID", "week"]); dataset=[dataset table(nan(size(da...

más de 4 años hace | 1

| aceptada

Respondida
How do I use regexp to break a string based on the first set of parentheses?
solution: str="@(a23bcd)e5./(f+g)"; answer=regexp(str,'@\(([^\)]+)\)([^\n]+)','tokens'); firstpart=answer{1}{1} secondpart=...

más de 4 años hace | 0

| aceptada

Respondida
Why is this while loop not working? Prime number from list
because what you want to write in matlab would be like this: while ~isempty(list)

más de 4 años hace | 0

| aceptada

Respondida
The end part of a set of cell arrays without loop
solution: endpart=cellfun(@(x) x(end),aa(3:end))

más de 4 años hace | 0

Respondida
How can I intersect between two cell array?
intersect(SI{1},SI{2})

más de 4 años hace | 0

| aceptada

Respondida
How can I pass a function into a function and find the minimum?
solution: f=@(a) myfunc(X + a * grad); a = fminsearch(f,0)

más de 4 años hace | 0

Respondida
How can i use imshow to read matrix??
solution: A=reshape(split(num2str(1:25,'image%i.jpg ')),5,5)'; figure imshow(cell2mat(cellfun(@imread,A,'uni',false)))

más de 4 años hace | 0

Respondida
How to make difference between two cell array?
solution: NSbutnotsetL=NS(~cellfun(@(y) any(cellfun(@(x) isequal(x,y),setL)),NS))

más de 4 años hace | 1

| aceptada

Respondida
Removing regions with holes
BW = bwpropfilt(yourmask, 'Solidity', [0.94, 1]); you can change the value of 0.94 depending on how strict you want to be, if y...

más de 4 años hace | 0

| aceptada

Respondida
Eliminating Matrix Elements Which Exceeds Some Threshold with Using idx
A is a Matrix of m rows by n columns, therefore, idx is going to be a logical vector of m rows by 1 column, if any element in th...

más de 4 años hace | 1

| aceptada

Respondida
what is the meaning of figure in matlab
figure creates a new empty figure where you can graph points, or show an image with imshow, here you can see the documentation o...

más de 4 años hace | 0

Respondida
Restarting the comand "for"
solution: a=true; while a for m1 = 0.0001:0.01:0.1 statements if (reeal ~= 0) fileID = fopen('C:\Users\...

más de 4 años hace | 0

Respondida
Finding number of answers from for loop that fits criteria
solution: p=zeros(1,30); for n = 1:30 p(n) = anova1(A(n,:), locations', 'off'); end anss = sum(p<0.05)

más de 4 años hace | 0

| aceptada

Respondida
Trouble with inline functions.
inline is replaced by handles function: f = @(t,x) [x(2);-sin(x(1))]; xystart = [2 1]; tEnd=30; [t,xa] =ode45(f,[0,tEnd],xys...

más de 4 años hace | 1

| aceptada

Respondida
How to reference entire substring as a string?
solution: textarr={'ExA'; 'ExB'; 'ExC'; 'ExD.exe'} textarr=strrep(textarr,'.exe','')%remove

más de 4 años hace | 1

| aceptada

Respondida
i want create this matrix
solution : m=[ones(5,1) pi*eye(5) (5:9)']+[diag(4,3)+diag(3:4,2) zeros(4,3 ); zeros(1,7)]

más de 4 años hace | 0

Respondida
merging two datasets based on two identical rows in each data set
solution: [~,n]=ismember(A(:,2:3),B(:,1:2),'rows') C=[A B(n,end)]

más de 4 años hace | 0

| aceptada

Respondida
remove and save row of matrix in while loop
With a cycle as you require: remove_b = [] a = [0,1,1,1,1,0,1; 0,0,1,1,0,1,1; 0,0,0,1,1,0,1; 0,0,0 , 0, 1,1,0; 0,0,0,0,0,0,0];...

más de 4 años hace | 0

| aceptada

Respondida
how do I translate this intruction in matlab?
solution: S=3;%any value of S W=[1 2 3 4 8]; %aný value of W C=[];%C={} C(end+1)=S%C <- C U {S} W=setdiff(W,S)%W <- W...

más de 4 años hace | 1

| aceptada

Respondida
Replace initial values of an matrix.
solution in general: B=B(horzcat(1:size(B,1),repmat(size(B,1),1,size(A,1)-size(B,1))),:) particular: B=B([1:3 3],:)

más de 4 años hace | 0

| aceptada

Respondida
Combining duplicate strings in an array
solution: [m,n,l]=unique(join(sort(x(:,1:2)')')); y= horzcat(split(m),cellstr(num2str(sum(repmat(n',size(x,1),1)==l)')))

más de 4 años hace | 0

Respondida
For each value in a vector, find the closest value in a cell and return index
a better way: sampled_freqs = [495 393 589]; values =[392, 440, 493.88, 523.25,587.33]; names={'G4' 'A4' 'B4' 'C5' 'D5'}; [...

más de 4 años hace | 1

Respondida
How do I split a column into a set group? (MATLAB beginner, help would be appreciated).
solution: listofnumbers=rand(360,1);%put your list here threshold=0.08; %your threshold here walking_segments_loop=(var(resh...

más de 4 años hace | 0

Respondida
How to implement this formula in MatLab?
directly: n=100; x=rand(1,n); s=std(x) or with a loop: n=100; x=rand(1,n); xmean=mean(x); sumt=0; for i=1:n sumt...

más de 4 años hace | 1

| aceptada

Respondida
Index exceeds the number of array elements (1). Error in heun_method (line 15) K1(i)=fprime(x(i),y(i));
function heun_method(fprime,y0,dx,x0,b,n) clear variables; clc; x0 = 0; y0 = 1; n = 10; b = 1; fprime = inline('2-3*X+4*Y...

más de 4 años hace | 0

| aceptada

Respondida
String replace with next character
solution: function output=yourfunction(n,e) output=char(mod(double(e)-97+n,26)+97); end

más de 4 años hace | 0

Respondida
Encryption of a string
solution: function output=yourfunction(n,e) output=char(double(e)+n) end

más de 4 años hace | 0

| aceptada

Respondida
How to calculate cumulative average of every n values in a matrix?
solution: mean100x20=reshape(mean(reshape(A,3,[])),100,[])

más de 4 años hace | 1

Cargar más