How do I create a vector by repeating a vector
A = [1; 2] ; B = repmat(A,2,1)

5 dagen ago | 1

Saving Table in Excel while in loop
Loop is not needed, you can striaght away write the matrix into excel. writematrix(AllMI,'test.xlsx');

5 dagen ago | 0

| accepted

How to save output images after preprocessing into new folder sequentially without overwriting?
infolder = '' % give the path of the folder where your RGB images are present outfolder = '' % give the path of the folder...

5 dagen ago | 0

| accepted

Invalid Training data. The Output size of the last layer does not match the reponse size
This is due to number of filters at Final-convolution layer. DEfault it has number of filters as 2, you need to change it to 1. ...

5 dagen ago | 0

| accepted

Help with symbolic substitution
Why don't you use anonymous function ? zz = @(x) (x(1) + x(2) + x(3))^2/(x(1)^2 + x(1)*x(2) + x(1)*x(3)) ; % Generate a rando...

6 dagen ago | 0

Compare elements of an array with all elements in a matrix
No loop needed. You can use straight away like shown: P = randn(18,10); C = randn(1,10); C1 = repmat(C,18,1) ; idx = C1 >...

6 dagen ago | 0

| accepted

Reading and Processing Many Text Files
txtFiles = dir('*.txt') ; N = length(txtFiles) ; for i = 1:N thisFile = txtFiles(i).name ; fid1 = fopen(thisFile)...

6 dagen ago | 0

Variable out_vec must be of size [1 3]. It is currently of size [1 20]. Check where the variable is assigned a value.
x = 1:20 ; idx = sort(randperm(length(x),3)) ; % select randomly x(idx)

6 dagen ago | 0

Accessing elements in a structure
file = dir('*.mat'); %fine all the .mat files num_files = length(file); %record how many files have been found [~, index] = na...

6 dagen ago | 0

| accepted

Fit data to array values
x = 1:5 ; y = [0.987,0.95,1.06,1.02,1.04] ; p = polyfit(x,y,2) ; yi = polyval(p,x) ; figure hold on plot(x,y,'.r') pl...

6 dagen ago | 0

How to avoid scientific notation in tables?

6 dagen ago | 0

keep getting Index exceeds matrix dimensions.
The error is clear.....you are trying to extract more number of elements than present from an array. EXample: A = rand(1,5) ;...

6 dagen ago | 0

To find Maximum value and minimum value for each group of four rows for a 180*1 matrix
A = rand(180,1) ; B = reshape(A,12,[])' ; themax = max(B) ; themin = min(B) ;

6 dagen ago | 0

| accepted

How to generate a matrix of random decimal values from -1 to 1?
format long A = single(rand(3)) ; fmt = [repmat(' %0.6f',1,3),'\n']; fprintf(fmt,A)

6 dagen ago | 0

adding data to a cell array without loosing the order
idx = 1:24000; id = reshape(idx,5,[])' ; [m,n] = size(id) ; C = cell(m,n) ; for i = 1:m for j = 1:n C{i,j} =...

6 dagen ago | 0

| accepted

given two matrices find the indices of B in A
Read about ismember, in there you can specify the option of rows. https://in.mathworks.com/help/matlab/ref/double.ismember.htm...

6 dagen ago | 0

Getting an array of points along an arc
clc; clear all ; figure; a = [124.0102 62.2260]; b = [33.3602 77.9434]; r=250; syms x y [x,y]=solve((x-a(1))^2+(y-a(2)...

6 dagen ago | 0

| accepted

How to scatter3 row vector with different colors
LEt A be your 3*510 matrix. x = A(1,:) ; y = A(2,:) ; z = A(3,:) ; scatter(x,y,10,z,'.'); If you want to use scatter3. ...

6 dagen ago | 0

combined Filled area and contour plotting

6 dagen ago | 0

Change the value in multiple text file?
You need not to take a loop, you can straight away use the logical indexing. ZEE=xlsread('zee.xlsx','Area','B2:MP138'); ZEE=Z...

7 dagen ago | 0

Generate training progress plot from saved trained model
[testnet,traininfo] = trainNetwork(augimdsTrain,lgraph,options); save('data.mat','testnet','traininfo') traininfo has the deta...

7 dagen ago | 0

| accepted

Is it possible to create a road at once in shp file data?
S = shaperead(filename) ; P = [[S(:).X]' [S(:).Y]'] ; plot(P(:,1),P(:,2))

7 dagen ago | 0

Creating hourly average data with geographic coordinates to produce 3D matrix
T = readtable('New Text document.txt') ; t = T.hour ; lon = T.lon ; lat = T.lat ; temp = T.temp ; [c,ia,ib] = uniqu...

7 dagen ago | 0

how to plot by varying initial conditions
function myfun() %plot n vs x n vs y R = cell(10,1) ; figure hold on for n=1:10 [t,r]=ode45(@fn,[0 140],[0.01+n 0.01 ]) ;...

8 dagen ago | 0

scatter3 color projection
clc; clear all ; load('test_data.mat') x=test(:,1); y=test(:,2); z=test(:,3); figure scatter(x,y,1000,z,'s','filled'); ...

8 dagen ago | 0

| accepted

How to make scatter
Fit striaght line to the given data using polyfit. Plot the line using plot function. Use hold on Plot the given data using ...

9 dagen ago | 1

2D Colored Plot
You can get the indices of the required values and plot them with different colors. x = 0:.05:2*pi; y = sin(x); figure hold...

9 dagen ago | 1

How to search closest coordinate values in a Lat Long Z data

10 dagen ago | 0