Answered

Move to next selection

so you don't need to place an else in the first: choice = menu("Do you want to see the opening times of this recycling centre?...

Move to next selection

so you don't need to place an else in the first: choice = menu("Do you want to see the opening times of this recycling centre?...

environ 2 mois ago | 0

| accepted

Answered

How to read multiple video from a folder....?

s=dir('*.avi'); files={s.name}; for k=1:numel(files) v= VideoReader(files{k}); j=0; while %condition %yourcodehere en...

How to read multiple video from a folder....?

s=dir('*.avi'); files={s.name}; for k=1:numel(files) v= VideoReader(files{k}); j=0; while %condition %yourcodehere en...

environ 2 mois ago | 0

| accepted

Answered

How do I produce a plot as a line, not just single points?

solution: figure; %hold on; deltaH=-20; R=0.001987; T1=305; Kc1=1000; T=300:10:600; Kc=Kc1.*exp(-(deltaH/R).*((1./T)-(...

How do I produce a plot as a line, not just single points?

solution: figure; %hold on; deltaH=-20; R=0.001987; T1=305; Kc1=1000; T=300:10:600; Kc=Kc1.*exp(-(deltaH/R).*((1./T)-(...

environ 2 mois ago | 0

| accepted

Answered

How to save output from loops into matrix w/o using vector input?

test it %% Load Matlab Directory myFolder = pwd; % Wherever you want. filePattern = fullfile(myFolder, '*.mat*') theFiles =...

How to save output from loops into matrix w/o using vector input?

test it %% Load Matlab Directory myFolder = pwd; % Wherever you want. filePattern = fullfile(myFolder, '*.mat*') theFiles =...

environ 2 mois ago | 0

| accepted

Answered

My code keeps saying the variable u appears to be changing as well as index exceeds the number of array elements(1). Could someone help me with this

correction: L = 1 % length of domain in x direction tmax = 10 % end time nx = 11 % number of nodes in x direction nt = 1...

My code keeps saying the variable u appears to be changing as well as index exceeds the number of array elements(1). Could someone help me with this

correction: L = 1 % length of domain in x direction tmax = 10 % end time nx = 11 % number of nodes in x direction nt = 1...

environ 2 mois ago | 0

Answered

Difference between "mesh" plot and "plot3" graphs

The main notable difference is that mesh draws a three-dimensional surface while plot3 only draws three-dimensional lines, you c...

Difference between "mesh" plot and "plot3" graphs

The main notable difference is that mesh draws a three-dimensional surface while plot3 only draws three-dimensional lines, you c...

environ 2 mois ago | 0

| accepted

Answered

Sum two arrays using logical indices

Could it be that way? : a (or (a_logical, b_logical)) + b (or (a_logical, b_logical))

Sum two arrays using logical indices

Could it be that way? : a (or (a_logical, b_logical)) + b (or (a_logical, b_logical))

environ 2 mois ago | 0

Answered

saving to cell2mat without overwriting

x = B(:,2) A=[]; for i=3: length(B) y = B(:,i) [fitresult, gof] = createFit(x, y) A=[A cell2mat(struct2cell(gof))] end

saving to cell2mat without overwriting

x = B(:,2) A=[]; for i=3: length(B) y = B(:,i) [fitresult, gof] = createFit(x, y) A=[A cell2mat(struct2cell(gof))] end

environ 2 mois ago | 0

| accepted

Answered

How can I use Textbox input from GUI in a separate script?

you can simply call the function at the end, without the extension .m and it must be in the same folder of the graphical interfa...

How can I use Textbox input from GUI in a separate script?

you can simply call the function at the end, without the extension .m and it must be in the same folder of the graphical interfa...

environ 2 mois ago | 0

Answered

why save '.mat' as 'ascii' file appears as FILE instead of txt

because the computer has to be guided by the file extension to know what each thing is, all the .mat files are going to open wit...

why save '.mat' as 'ascii' file appears as FILE instead of txt

because the computer has to be guided by the file extension to know what each thing is, all the .mat files are going to open wit...

environ 2 mois ago | 0

Answered

create a new matrix that extracts the values in matrix A as stipulated in matrix B

C=B(A);

create a new matrix that extracts the values in matrix A as stipulated in matrix B

C=B(A);

environ 2 mois ago | 0

| accepted

Answered

How to swap array element from two arrays conditionally

C=A; C(B~=0)=B(B~=0) also could help you: C=max(A,B)

How to swap array element from two arrays conditionally

C=A; C(B~=0)=B(B~=0) also could help you: C=max(A,B)

environ 2 mois ago | 1

Answered

Reading in data from files in for loop

%var def% lopoff = 1034; %initial data point sample_stopcount = 41000; %last data point folder = uigetdir('C:\Users\me\Docume...

Reading in data from files in for loop

%var def% lopoff = 1034; %initial data point sample_stopcount = 41000; %last data point folder = uigetdir('C:\Users\me\Docume...

environ 2 mois ago | 0

Answered

feval problem Too many inputs to inline function.

a=0 b=2 y=5 x=1/2 f1=inline('(1+x^2)/(sqrt(x)+3)') f2=inline('(1+x^2)/(sqrt(x)+3)') f3=inline('(1+x^2)/(sqrt(x)+3)') f4=i...

feval problem Too many inputs to inline function.

a=0 b=2 y=5 x=1/2 f1=inline('(1+x^2)/(sqrt(x)+3)') f2=inline('(1+x^2)/(sqrt(x)+3)') f3=inline('(1+x^2)/(sqrt(x)+3)') f4=i...

environ 2 mois ago | 0

Answered

How can i locate where two column values are the same in a row?

a=[1 2 3 4 4 4 4]; s=find([diff(a) 1]==0,1,'first')

How can i locate where two column values are the same in a row?

a=[1 2 3 4 4 4 4]; s=find([diff(a) 1]==0,1,'first')

environ 2 mois ago | 0

Answered

Add a command for unique permutations

you can make list = unique (InitialPopulation (60,3), 'rows') but it would no longer be 60 in size On the other hand if y...

Add a command for unique permutations

you can make list = unique (InitialPopulation (60,3), 'rows') but it would no longer be 60 in size On the other hand if y...

environ 2 mois ago | 0

Answered

How to copy the last row on matrix that varies with input

lastrow=matrix(end,:)

How to copy the last row on matrix that varies with input

lastrow=matrix(end,:)

environ 2 mois ago | 0

| accepted

Answered

Find the unique pair of coordinates in matrix and depending on the distance matrix, retain the minimum distance matrix and replace the other coordinate pair by NaN

a solution: [uv,~,idx] = unique(R,'rows'); v = accumarray(idx,distance,[],@min); eliminate=~ismember([R distance],[uv v],'ro...

Find the unique pair of coordinates in matrix and depending on the distance matrix, retain the minimum distance matrix and replace the other coordinate pair by NaN

a solution: [uv,~,idx] = unique(R,'rows'); v = accumarray(idx,distance,[],@min); eliminate=~ismember([R distance],[uv v],'ro...

environ 2 mois ago | 0

| accepted

Answered

weight and bias values i get from trained neural network is mistake?

It is not the same because Matlab does a normalization procedure of the variables so if you want to do it manually it would be l...

weight and bias values i get from trained neural network is mistake?

It is not the same because Matlab does a normalization procedure of the variables so if you want to do it manually it would be l...

environ 2 mois ago | 0

| accepted

Answered

How to find length of the ROI?

Assuming it is a Rectangular one, then it depends on what you call length in a rectangle, the ROI is defined by 4 values [xmin, ...

How to find length of the ROI?

Assuming it is a Rectangular one, then it depends on what you call length in a rectangle, the ROI is defined by 4 values [xmin, ...

environ 2 mois ago | 0

| accepted

Answered

Is anyone able to remove the display part of this function?

clear; close all; clc; xy = [ 3 12 10 8 11 14 13 16 9 19 1 15 2 4 6 1 11 3 16 5 14 17 19 18 ]; xy = xy'; ...

Is anyone able to remove the display part of this function?

clear; close all; clc; xy = [ 3 12 10 8 11 14 13 16 9 19 1 15 2 4 6 1 11 3 16 5 14 17 19 18 ]; xy = xy'; ...

environ 2 mois ago | 1

Answered

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; ...

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; ...

environ 2 mois ago | 0

| accepted

Answered

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...

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...

environ 2 mois ago | 1

| accepted

Answered

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=...

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=...

environ 2 mois ago | 0

| accepted

Answered

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)

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)

environ 2 mois ago | 0

| accepted

Answered

The end part of a set of cell arrays without loop

solution: endpart=cellfun(@(x) x(end),aa(3:end))

The end part of a set of cell arrays without loop

solution: endpart=cellfun(@(x) x(end),aa(3:end))

environ 2 mois ago | 0

Answered

How can I intersect between two cell array?

intersect(SI{1},SI{2})

How can I intersect between two cell array?

intersect(SI{1},SI{2})

environ 2 mois ago | 0

| accepted

Answered

How can I pass a function into a function and find the minimum?

solution: f=@(a) myfunc(X + a * grad); a = fminsearch(f,0)

How can I pass a function into a function and find the minimum?

solution: f=@(a) myfunc(X + a * grad); a = fminsearch(f,0)

environ 2 mois ago | 0

Answered

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)))

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)))

environ 2 mois ago | 0