Respondida
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); ...

más de 9 años hace | 1

| aceptada

Respondida
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*'); ...

más de 9 años hace | 0

Respondida
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...

más de 9 años hace | 1

| aceptada

Respondida
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...

más de 9 años hace | 0

| aceptada

Respondida
Issues with Matrix Multiplication
i_D=I0.*(exp((q*v_D)./(k*T(ii)))-1);

más de 9 años hace | 0

| aceptada

Respondida
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; ...

más de 9 años hace | 0

Respondida
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...

más de 9 años hace | 1

Respondida
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...

más de 9 años hace | 0

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

más de 9 años hace | 0

Respondida
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))

más de 9 años hace | 0

Respondida
Is there a way to extract specific fields from a structure?
help getfield

más de 9 años hace | 2

Respondida
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...

más de 9 años hace | 0

| aceptada

Respondida
how can convert a mat file to netcdf?
Use ncwrite

más de 9 años hace | 0

Respondida
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...

más de 9 años hace | 0

Respondida
finding a string in a cell array
out = find(cell2mat(regexp(ids1, 'EPS[1-5]MN')))

más de 9 años hace | 0

Respondida
"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...

más de 9 años hace | 0

Respondida
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...

más de 9 años hace | 1

| aceptada

Respondida
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', ','...

más de 9 años hace | 0

| aceptada

Respondida
Legend position change after printing
Use set(gcf,'PaperPositionMode','auto'); before printing. It works for me (R1015b).

más de 9 años hace | 0

Respondida
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...

casi 10 años hace | 0

| aceptada

Respondida
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...

casi 10 años hace | 1

| aceptada

Respondida
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...

casi 10 años hace | 0

Respondida
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)) ...

alrededor de 10 años hace | 1

| aceptada

Respondida
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...

alrededor de 10 años hace | 0

Respondida
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 = ...

alrededor de 10 años hace | 0

| aceptada

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

alrededor de 10 años hace | 0

Respondida
Saving a figure with several subplots on to a file
print(figHandle,'-dpng','-r0',name)

alrededor de 10 años hace | 1

| aceptada

Respondida
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 ...

alrededor de 10 años hace | 0

Respondida
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...

alrededor de 10 años hace | 2

Respondida
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...

alrededor de 10 años hace | 0

Cargar más