name matrix as A1 to A50 automatically [duplicate] - matlab

This question already has answers here:
Create variables with names from strings
(6 answers)
How to Dynamically Create Variables in MATLAB [duplicate]
(3 answers)
Closed 5 years ago.
I run an algorithm that result of it is a matrix as A. I run an algorithm 50 times and I want to save results as A1 to A50 matrix. how can I write?

Related

Swift random element with probability [duplicate]

This question already has answers here:
Generate random numbers with a given distribution
(4 answers)
how to generate random numbers from 1 to 4 and 8 in swift
(2 answers)
Closed 4 months ago.
It seems like randomElement() in Swift only allows for an equally weighted selection. What would be the best (and most efficient way, as I need to repeat this very often) to select from a collection with pre-specified probabilities/weights?

How to index and change a value within a matrix using a variable? [duplicate]

This question already has answers here:
Use a vector as an index to a matrix
(3 answers)
Compact MATLAB matrix indexing notation
(3 answers)
Closed 4 years ago.
For example, I have a variable i and I want to set i=(2,3) such that B(i)=B(2,3)=7.
B=[1 2 3 4
5 6 7 8];
i=('2,3');
B(i)
I am kind of stuck here. Please help.

knn compare 2 images matlab [duplicate]

This question already has answers here:
Image comparison - fast algorithm
(12 answers)
Image similarity comparison
(7 answers)
Closed 5 years ago.
I need a help. I don't know how to write a Matlab/Java code compare 2 images using KNN, the result should take "wrong" when image 2 is different than image 1. I have to imporve displacement between x1,x2,x3 and that each subsequent generated image with the same x1,x2,x3 is invalid (Prove that the diameter has increased). Others compare it with histograms. Anybody will help me?

MATLAB: How to randomize the rows of a matrix? [duplicate]

This question already has answers here:
Random order of rows Matlab
(4 answers)
Closed 7 years ago.
I'm looking for an efficient way to manipulate a 40x151 matrix so that the rows are randomly scrambled.
I worked out the answer just as I was about to post.
new_matrix = old_matrix(randperm(40),:)

how to rearrange each block into a column vector? [duplicate]

This question already has answers here:
Efficient Implementation of `im2col` and `col2im`
(2 answers)
Closed 7 years ago.
example: I have an image,it's size 512X512pixel,then i have splited it into 8x8 blocks.Now i would have 64x64 blocks.Now how to rearrange each block 8x8 into column vector so that the dimension would be 64x4096pixel without inbuilt function "im2col".please help me out.
Thanks.
x=rand(512,512);
xi=mat2cell(x,8*ones(1,64),8*ones(1,64));
xii=cellfun(#(x)reshape(x,1,64),xi,'UniformOutput',false);
y=cell2mat(xii);