Answered
how to define 4 bit Enumerated value and a nibble(4 bits) in Matlab
Use a number between 0 and 15. n = 8; To convert to binary nbin = dec2bin(n) - '0'; dec2bin return a string, th...

10 years ago | 0

| accepted

Answered
given a natural number N, find a natural number n such that max ((n!)^2 <=N)
N = 1400; n = 1; while prod(1:n)^2 < N n = n + 1; end; n = n - 1

10 years ago | 0

Answered
Display plot on image
x = cumsum(Volt_and_time(2,:)); y = cumsum(Volt_and_time(1,:)); overlayplot(x,y,image, 'fitbinary') using my function...

10 years ago | 0

Answered
How to count the number of zero subcells in a cell?
If you have a cell array of matrices: C{1,1} = ones(1,32); C{1,2} = 2*ones(1,32); C{2,1} = zeros(1,32); C{2,2} = z...

10 years ago | 0

Answered
Speed up Gaussian Fitting of many points
So the problem is the fitting. There are some alternative methods if you google "matlab fit 2D gaussian", like <http://www.mathw...

10 years ago | 0

Answered
Applying Matlab variables in a UNIX command
You can create the folder in Matlab as follows: path = '/User/foobar/Matlab/xxx'; folder = 'test'; mkdir(fullfile(path, ...

10 years ago | 0

Answered
Change Minimum Distance of Zero Matrix
m = [0 0 0 0 1 2 2 0 0 5 3 4 5 0 0 0 0 0 9 9 0 0 0]; custom_value = 1; ind = diff([1 m 1] == 0); i1 = find(ind == 1);...

10 years ago | 0

Answered
Conversion of 3d array to 2d array in text file
%% define some constants filename = 'data1.txt'; NLongitude = 19; NLatitude = 17; NStdPressureLev = 24; %% ...

10 years ago | 1

Answered
Error using surf plot
You can use K = zeros(length(yf), length(xf)); % note that yf is first, xf is second because ...

10 years ago | 1

| accepted

Answered
I want draw a graph correctly
With your axis command you cut off the z values at 0 (with the third 0 in axis([0 2 0 2 0 6]). Instead, use: Z = F3(X,Y); ...

10 years ago | 0

Answered
How i add a line in 2d plot
You can plot the horizontal line using line([min(xlim) max(xlim)], [4 4], 'Color', 'r', 'LineStyle', '--') If you have co...

10 years ago | 0

Answered
Recieving error that states "Vectors must be the same length".
By changing the increment you have changed the length of X (from 5 to 7 in your case). If Y matches X (with 5 elements), it does...

10 years ago | 0

Answered
Matlab Plotting Code erroe
You have to squeeze the singleton dimension: n = 10; A = rand(5,6,n); plot(squeeze(A(2,3,:)))

10 years ago | 0

Answered
How to detect the edge of the photo
You can use imfindcircles to detect the circle, and then set all points outside the circle to black. See <http://stackoverflow.c...

10 years ago | 0

Answered
what is the meaning of gold standard in DRIVE data base?
The data base states The set of 40 images has been divided into a training and a test set, both containing 20 images. Fo...

10 years ago | 0

| accepted

Answered
Hey people :) How would i write a Matlab script that asks a group of up to 40 members to enter their height (in cm) and their weight (in kg)?
N = 40; for i = 1:N height(i) = input('Please enter your height (in cm) >> '); weight(i) = input('Please enter y...

10 years ago | 1

Answered
Find submatrix with the maximum sum
You can set maxval = -Inf; before the loop and then compare if the sum of the current submatrix is greater than maxval: if so, s...

10 years ago | 0

Answered
How to compare results from three different programs together
nodes = 100; % or how many nodes you want d1 = dtdma2(nodes); d2 = stdma2(nodes); d3 = csma2(nodes); plot(1:nodes, d1, ...

10 years ago | 0

Answered
how can i get function of sinh in taylor series
The loop runs over k, but you use n in the formula.

10 years ago | 1

Answered
How to multiply a (2 by 2) matrix M with M [i.e M*M'] where the elements of the matrix M are also matrices ?
M={a1.*x, a2.*y; a3.*x, a4.*y}; A = cellfun(@(x) x*x', M, 'UniformOutput', false);

10 years ago | 0

Answered
Manipulate values on axes MATLAB
set(gca, 'XTickLabel', 0:10)

10 years ago | 0

Answered
[Beginner] MATLAB : Error ??? Index exceeds matrix dimensions but I can't fix it
What does size(zb_gt) return before those lines? Presumably it has to few rows.

10 years ago | 0

Answered
Base workspace variable name
S = whos; varname = {S.name};

10 years ago | 0

| accepted

Answered
how to count non breaking ones from matrix?
For a single column, use diffcol = diff([0; col; 0]); n = max(find(diffcol==-1)-find(diffcol==1)); Just loop over eac...

10 years ago | 0

| accepted

Answered
Using regexp in a repetitive manner
line = 'type="line" coords="461,461,461,487,461,487,461,489,462,490,462,492,463,493,464,494,465,495,467,495,468,496,470,496,47...

10 years ago | 0

Answered
In which quadrant is a point?
If cx, cy is the center of your circle, you first determine the angle between point px, py and relative to the center: alpha...

10 years ago | 3

Answered
Save workspace to a specific folder using regular expression
imagename = ... %whatever you use to extract the imagename filename = [imagename '.mat']; save(fullfile(newfullpath, filena...

10 years ago | 2

| accepted

Answered
how to input values in a 2D matrix using a nested for loop of size 5*5?
for i = 1:5 for j = 1:5 A(i,j) = input(sprintf('please enter value (%d, %d) >> ', i, j)) end end

10 years ago | 2

| accepted

Answered
how to copy multiple files from a source folder to a destination folder
On Unix/Linux/MacOS, to copy all files that have a single character followed by at.txt, you can use system('cp ?at.txt newf...

10 years ago | 0

Load more