Réponse apportée
how to reach amount of entropy of image in between the range [0,1] ?
You can scale the output by the maximum entropy for this image H = entropy(I); N = numel(I); maxH = entropy([1:N]/N); ...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
dbhole.mat contains 334 files. each files consists of [2xn] data. i sort these files with name starting with 'd' and fixed 'h2'. if h2 is not fixed, then what will be the code for doing this?
I would organise the data into a 2D cell data{}{} and work with this structure. load dbhole.mat W = whos('d*h*'); ...

plus de 9 ans il y a | 0

Réponse apportée
Edge detection is working too well for me?
If the walls are always vertical, you can sum the output of the edge detector across all rows and determine the x positions from...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
hello sir i want real values but when i write my function in matlab s(ii)==real (s(ii)); it give me complex value how to solve it
real is the real part of a complex number. Unless you do not have re-defined Matlab's real, this should work. To check if you...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Issues with Matrix Multiplication
i_D=I0.*(exp((q*v_D)./(k*T(ii)))-1);

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
search for a string in a set of cell arrays
Strings_1 = {'abc';'def'} Strings_2 = {'ghi';'jkl'} str = 'def'; S{1} = Strings_1; S{2} = Strings_2; ...

plus de 9 ans il y a | 0

Réponse apportée
Could someone please help me speed up my code?
I found this to run much faster (about 23s on my machine): preallocate RMS_new, move the squaring and the division by N (to comp...

plus de 9 ans il y a | 1

Réponse apportée
Unbalanced or unexpected parenthesis or bracket.
If you have a pre-2009b version, the tilde could cause the error. Replace each tilde ~ with something like dummy or variable_not...

plus de 9 ans il y a | 0

Réponse apportée
How to load only a subset of .dat files into MATLAB?
for k=1:6 load(files(k).name); end

plus de 9 ans il y a | 0

Réponse apportée
Select subset of data going backwards
i1 = find(a(:,6) > 0, 1, 'first') i2 = find(a(1:i1, 3) == 1, 5, 'last') res = flipud(a(i2, 4))

plus de 9 ans il y a | 0

Réponse apportée
Is there a way to extract specific fields from a structure?
help getfield

plus de 9 ans il y a | 2

Réponse apportée
How to change a certain value color in pcolor
cmap = colormap; N = 10; x = linspace(1, size(cmap, 1), N); cmap = cmap(x, :); pink = [255 204 221]/255; cmap(5...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
how can convert a mat file to netcdf?
Use ncwrite

plus de 9 ans il y a | 0

Réponse apportée
cumsum within a group
data=[1 10 10; 1 10 20; 1 10 30; 1 10 40; 2 10 10; 2 15 25; 2 20 45; 3 5 5; 4 10 10]; % first column of tcumsum ye...

plus de 9 ans il y a | 0

Réponse apportée
finding a string in a cell array
out = find(cell2mat(regexp(ids1, 'EPS[1-5]MN')))

plus de 9 ans il y a | 0

Réponse apportée
"Exist" return 0 for a file it displays when using "ls"
On my system (MacOS 10.11) Matlab returns 2, as expected. I would try to get rid of the '.' in the file names and see if it work...

plus de 9 ans il y a | 0

Réponse apportée
Dear all: I have a 5*2 matrix. i want to find out the row and column of a special value.let A=[1 2;4 5; 1 8;2 6;9 7] I want to find the row and column of 9 and 7.how can i do this?
If your matrix has the same number of columns as your vector, as in your example, you just have to find the row: r = find(i...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
How to convert 'comma' to 'dot'?
You can use my function fstrrep to replace each . with a , and then use dlmread to read the data: fstrrep('test22.txt', ','...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Legend position change after printing
Use set(gcf,'PaperPositionMode','auto'); before printing. It works for me (R1015b).

plus de 9 ans il y a | 0

Réponse apportée
datestring shows incorrect answers
Igor Pro uses the seconds since 1904-01-01. So you can convert it using dv = datevec(3534468465.15625/(3600*24) + datenum(19...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Delete files with specific names
You can get the filenames using d = dir; filenames = {d.name}; Loop through the filenames for i = 1:numel(file...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
please explain this code mean? especially the 'm' and the 's'?
Have you considered looking at the reference? R. C. Gonzalez, R. E. Woods, & S. L. Eddins Digital Image Processing Using MATLA...

presque 10 ans il y a | 0

Réponse apportée
I have a two 2D Arrays with 140 zeros, for the 1st I want 70 numbers to have a value between 0 to 1, for the 2nd I want the remaining 70 to have a value <1 and >0
N = 140; ind = randperm(N); D1 = zeros(1,N); D2 = zeros(1,N); D1(ind(1:N/2)) = rand(1,N/2); D2(ind(N/2+1:end)) ...

environ 10 ans il y a | 1

| A accepté

Réponse apportée
In a table with duplicate ids, how do I merge rows with values with rows with NaNs?
X = [3101 6 NaN 6 NaN 3101 NaN NaN NaN 1 3101 NaN 4 NaN NaN 8701 5 5 5 Na...

environ 10 ans il y a | 0

Réponse apportée
Save text files without an empty line in the end?
Use fprintf with newline \n for all but the last entry in x, which is written separately without \n: x = [1;2;3]; fid = ...

environ 10 ans il y a | 0

| A accepté

Réponse apportée
How to place the last alphabetic character from TS1
TS1='%@3Gb6'; Lastletter = TS1(max(regexp(TS1, '[a-zA-Z]')))

environ 10 ans il y a | 0

Réponse apportée
Saving a figure with several subplots on to a file
print(figHandle,'-dpng','-r0',name)

environ 10 ans il y a | 1

| A accepté

Réponse apportée
can any one help me for the code
Si = rand(1,100)>0.5; % fake some sample data f = rand(1, 100); fmin = 0.3; fmax = 0.7; Siplus = Si; % the otherwise ...

environ 10 ans il y a | 0

Réponse apportée
To accept two numbers from the user and display perfect numbers between these two numbers. Can anyone help to convert this codes to somethings simpler to understand?? It's too complicated for me as i'm still new to matlab...
The if clause may be too tricky for a beginner: (sum(test(mod(i,test) == 0)) == i) Let's walk through it from the innerm...

environ 10 ans il y a | 2

Réponse apportée
imcrop won't work
I = rand(1000, 2000); rect = [1029,535,1,1]; Ic = imcrop(I, rect) The thing to remember is that the rect is given by [xm...

environ 10 ans il y a | 0

Charger plus