Réponse apportée
Encryption of a string
solution: function output=yourfunction(n,e) output=char(double(e)+n) end

environ 6 ans il y a | 0

| A accepté

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

environ 6 ans il y a | 1

Réponse apportée
find new matrix whose rows summation is between two integers
solution: B=A(and(sum(A,2)>=130,sum(A,2)<=135),:)

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Remove specific entry in a cell array
solution: element_row{1,1} = [1 10 18 24 31 40 0] element_row{1,2} = [2 11 19 25 32 41 49 -1] element_row{1,1}(end)=[]; ele...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Fill inner holes in the image
change image.jpeg for the name of your image image=imread('image.jpeg'); mask=imfill(imclose(not(imbinarize(rgb2gray(image))),...

environ 6 ans il y a | 0

Réponse apportée
Load data from mat files to a matrix
if your data is called 1.mat, 2.mat, 3.mat and so on, and in addition each of these data contains a structure called "Data" and ...

environ 6 ans il y a | 0

Réponse apportée
Clear a Matrix from a multidimensional Matrix at each iteration
Matlab needs to make sure that all the indexes include all the values included, therefore it needs to be ":", I leave the soluti...

environ 6 ans il y a | 2

| A accepté

Réponse apportée
How can i find specified numbers in an array without using for loop?
solution: answer=cell2mat(arrayfun(@(x,a) find(ismember(x{:},a)),b,a,'Uni',false))

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Timeseries data in Matlab
try it: [filename,folder]=uigetfile('*.txt','please select your txt file'); a=readtable(fullfile(folder,filename)); time=dat...

environ 6 ans il y a | 0

Réponse apportée
add rows to a 344x2 matrix
Solution: matriz=zeros(344,2) for i = 1:length(a) j = a(i) b = gnbh(j,2) c = [j,b] matriz(i,:)=c; end

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Unable to perform assignment because the left and right sides have a different number of elements
congratulations! ,you did very well, just a few small changes: % Euler's Method % Initial conditions and setup h = 0.1; % s...

environ 6 ans il y a | 0

Réponse apportée
how to sum first 140 elements every time in an (1 * 21000) array
solution: a=rand(1,21000); b=sum(reshape(a,140,[]));

environ 6 ans il y a | 0

Réponse apportée
how can I sort a struct?
solution: x=1:5;%put your x here chr.id=[]; chr.sequence=[]; chr.Si={}; chr.relevant=[]; chr.vic_item = []; len=numel(x)...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
reset the counter in for loop
because the for loop once defined ignores some change in its variable and tries to execute normally, but with this you can solve...

environ 6 ans il y a | 1

Réponse apportée
how to validate that my inputs are not characters
enter1 = true; while (enter1 || ~valid) enter1 = false; choice = input('Would you like to play No Thanks? Enter 1 for...

environ 6 ans il y a | 0

Réponse apportée
Mean of 72720 rows in one column such that I can take mean of 720 rows separately.
data is your 72720 rows in one coloumn mean720=mean(reshape(data,720,[])); figure; plot(mean720)

environ 6 ans il y a | 1

Réponse apportée
can i make a loop for mentioned equation?
It would be something like this : Pb1dis =inf; Pb_dis2=3600; tol=0.0001;%tolerance while abs(Pb_dis2-Pb_dis)>tol Pb_d...

environ 6 ans il y a | 0

Réponse apportée
How can I save data when it is being generated in a loop?
you can check the xlswrite function and also the writetable function: example: a = 5; w = 0.2; ts = 0.1; t = -ts; y = 1; ...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
What does X = max(0,A) mean?
it means that some value less than 0 in matrix A will be replaced by 0 in order to have a matrix whose minimum value is 0, examp...

environ 6 ans il y a | 2

| A accepté

Réponse apportée
How to retrieve last 3 digits from each entry of a matrix of order 3 x 4 ?
solution: A = [35679, 35678, 35677, 35676; 35675, 35674, 35673, 35672; 35671, 35670, 35669, 35668]; last3digits=A-round(A,-3)...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
change numbers in array
you can do this: array = input('Please enter array'); array(array<=0)=nan or this : a=true; while a array = input('Ple...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Low contrast object detection
I leave you an example: close all RGB=imread('negativo/drone_image.jpg'); BW = (RGB(:,:,1) >= 142 ) & (RGB(:,:,1) <= 178) & ...

environ 6 ans il y a | 0

Réponse apportée
How to initialize an array such that the values satisfies an equation
I leave you a possible solution: L=300; y= -2*(rand(1,L)>0.5)+1;%put your y here alpha=rand(1,L-1); alpha(end+1)=-sum(alpha....

environ 6 ans il y a | 1

Réponse apportée
How to get n number of sample sets each containing m number of elements from a dataset
solution: v1=[1:1000];%put your dataset here n=16; m=4; [~, ind] = sort(rand(n,length(v1)),2); samples=v1(ind(:,1:m))

environ 6 ans il y a | 1

| A accepté

Réponse apportée
how can i fill matrix using a vector?
without repetition : v1=[1 4 8 9 3 6 ]; v2=[v1 zeros(1,4)];% change the amount of 0 to increase the probability in this ca...

environ 6 ans il y a | 1

Réponse apportée
str2func operation
type an expression that is a function of"y"'5*y+5' here there is no problem, remember the expression goes in single quotes...

environ 6 ans il y a | 0

Réponse apportée
how can i fill matrix using a vector?
solution: v1=[1 4 8 9 3 6 ]; v2=[v1 zeros(1,4)];% change the amount of 0 to increase the probability in this case there ar...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
how to create an error message when invalid data is input and then prompt to re-enter the data
person_age = input('Please enter persons age'); while person_age < 1 errordlg('Please input valid number','Error') ...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Deep Neural Network Training (Non-Image Classification)
For your problem I recommend that you use patternnet example: [x,t] = iris_dataset; %x is 4x150 (4 features,150 samples) , y...

environ 6 ans il y a | 0

Réponse apportée
Create main diagonal with repeated numbers but one exception
solution: n=5; M=diag([0 ones(1,n-1)])+ones(n)

environ 6 ans il y a | 1

| A accepté

Charger plus