Splitting part of image to smaller images
Image segmentation technique can be used to partition an image into multiple parts or regions, often based on the characteristi...

1 year ago | 0

Getting NaN for the mean of a vector, is this normal?
NaN returns the scalar representation of "not a number". Operations return NaN when they have undefined numeric results, such as...

1 year ago | 0

View matlab dates in normal view
you can use 'datestr ' function to see the actual date: Here is the example snap shows for your first number converted into dat...

1 year ago | 1

| accepted

Array dimensions must match for binary array op." How you solve that one? How to check the images have exactly the same row and column sizes, and the same number of dimensions (2 or 3).?
To check dimensions you can use: if ndims(Image1) == ndims(Image2) disp('dimensions are same'); else disp('Dimensi...

1 year ago | 0

I am new to matlab and have a sample data(shown on pic) with many values inside. I need to multiply each values with its different conversion coefficient. How can I do that?

1 year ago | 0

Matlab vector and arrays
You can use directly colon (:) operator. X=1:20 Y=10:25 For more info: https://www.mathworks.com/help/matlab/ref/colon.h...

1 year ago | 0

| accepted

if statement problem with function
This may help you: x = [-1:0.1:1]; f = (x.^2).*(sin(pi.*x)); g=zeros(1,length(f)); for i = 1:length(f) if f(i) >= 0 ...

1 year ago | 0

| accepted

Add data to .csv file using matlab
data = {'DateTime1' 'UserName1' 'Path1' 'Remark1'}; data1= {'DateTime2' 'UserName2' 'Path2' 'Remark2'}; Data = [data;data1]; ...

2 years ago | 0

| accepted

How to make a piecewise function and plot it ?
Instead of using h1, h2,h3 and h4 , you can use h variable for all 4 pieces of code. then use plot plot(th2,h);

2 years ago | 0

| accepted

more than one sl_customization file
As per my understanding with the matlab helppage, matlab recognizes the all sl_customization.m files in your path. To run specif...

2 years ago | 0

Matlab closes in the middle of a loop
I am not sure you will get exact answer but this may help: Increase java heap memory from preferences.

2 years ago | 0

Export Structure to csv file
You can try this: load Structure_Example.mat writetable(struct2table(PracTrials), 'Structure_Example.csv') The output cs...

2 years ago | 1

Error using load. Unable to read file '...'. Input cannot be a directory.
The mat file you are using this need to be in matlab current path. You can add folders and subfolders in path manually by right ...

2 years ago | 0

How to save Simulink model without model workspace saved
If you dont need any data from model workspace you could clear whole model workspace data simply by two lines. before save you ...

2 years ago | 0

How to replace two columns in a txt file?
This could help you: fid = fopen('test.txt'); C = textscan(fopen('test.txt'),'%s','delimiter','\n'); C=strrep(C{1}, '1.0269',...

2 years ago | 0

| accepted

How to change the gcc version in matlab
If you would like to change installed compiler: type on command window: mex -setup installed compiler options will be dis...

2 years ago | 0

Reading HEX data from text file in HEX format not decimal.
you could use textscan function: fid = fopen('hextest.txt'); data = textscan(fid, '%s')

2 years ago | 0

| accepted

Left and right sides have different number of elements error (Matrices, data handling).
You could try to store result in cell { } : for jtor = 1:n distance{jtor} = pdist([X(jtor,:)';T(itor,:)']); end or you c...

2 years ago | 0

How to store the indexes of the values which satisfies the given condition while running a loop. The condition is satisfied many times but at the end only i only get the index of last condition when value was satisfied.
Hopefully you are looking for the: %Code is here. You can change F(i)=i; F1(j)=j; to indices{end+1} = [i,j]; function indi...

2 years ago | 0

How can I store values that satisfies only the specific condition from the loop without overwrriting?
function indices=Saddle(M) [a,b]=size(M); P=max(M,[],2); Q=min(M); indices = {}; for i=1:a for j =1:b if P(i,...

2 years ago | 0