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

etwa 10 Jahre vor | 1

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 1

| akzeptiert

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 1

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 2

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 1

| akzeptiert

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 1

| akzeptiert

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 1

| akzeptiert

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 0

| akzeptiert

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 1

| akzeptiert

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 2

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

mehr als 10 Jahre vor | 0

Mehr laden