Answered
How to fill the area between two curves with discrete data and with a condition (y<0 & y>0)?
If you just want an easy way, consider using this: https://www.mathworks.com/matlabcentral/fileexchange/61327-anomaly load('da...

4 years ago | 0

| accepted

Answered
remove the zeros in the Matrix
If all you want is the intersection of all even rows and columns, just use indexing. z = randi([1 10],5,10) x = z(2:2:end,2:2:...

4 years ago | 0

Answered
Getting the mean from each cell row in a cell array
I'm sure there are more elegant ways than this, but eh. celery = {(1:5).' (2:2:8).' [3 6 9 1 5 6 8].'} n = cellfun(@numel,cele...

4 years ago | 0

| accepted

Answered
Hide Picture inside Image
For example: % host image A = imread('cameraman.tif'); sa = size(A); % payload image B = imread('hands1-mask.png'); B = ...

4 years ago | 0

Answered
How to convert an image to a plain text & inverse ?
There are countless ways to convert an image to text. A literal interpretation would be something like: % convert to text file...

4 years ago | 0

Answered
Problem : Index exceeds matrix dimensions
Replace this line K=uint64(str2num(K)); with this K = uint64(hex2dec(K(:,3:4))); That should work in older versions, and t...

4 years ago | 0

| accepted

Answered
Paste array a into array c based on the locations in array b
Assuming what you want is a vector, the example doesn't follow the description of the logic and the inputs given. Consider a =...

4 years ago | 0

Answered
How to add gray to out of range in the colormap?
You might try something like this: [x y z] = peaks(100); surf(x,y,z); shading flat camlight numcolors = 64; g = [1 1 1...

4 years ago | 0

| accepted

Answered
Histogram equalization without histeq (color)
It all depends on why you can't use histeq(). If you can't use histeq() because you don't have IPT, then MIMT has a drop-in rep...

4 years ago | 0

Answered
Change to code formatting behaviour in editor in R2021b?
I don't have anything newer than R2019b, but the documentation suggests that the same should apply. The SmartIndentWhileTypin...

4 years ago | 0

Answered
Shade area under a plot with MATLAB
I don't know what shade() you're using, since it's not part of MATLAB. Otherwise, you can do something with patch objects: y =...

4 years ago | 1

Answered
Changing the Shape of straight line when plotting
Try something like this: lineLength = 1; lineAngle = 45; npoints = 10; offset = [0 0]; % [x y] c = linspace(offset(1),off...

4 years ago | 1

| accepted

Answered
Image processing Gaussian noise
Something like this: % same as imnoise() defaults gaumean = 0; gauvar = 0.01; inpict = imread('cameraman.tif'); outpict =...

4 years ago | 0

Answered
How can convert a image from type of double(unit16) to a grayscale image?
The problem here isn't necessarily that the image isn't grayscale; it's that the data isn't scaled properly for other tools to k...

4 years ago | 0

Answered
Read three different RGB band and Swap the Band
More succinctly, you can just use indexing. A = imread('peppers.png'); % get an RGB image B = A(:,:,[2 3 1]); % pick a new cha...

4 years ago | 0

Answered
How to draw consecutive circles?
Here's an example. You'll need to adjust it for the number of cycles you want. I'm going to replicate the original image. s =...

4 years ago | 1

| accepted

Answered
how to detect the four corners of a binary image including many white squares?
I'm using a modified copy of the image because you only posted a screenshot of a figure. I'm assuming that you're asking for th...

4 years ago | 0

| accepted

Answered
I have a square matrix of ones and zeroes and I am trying to change all the ones to a user entered number. I am only successfully changing the first value in the matrix.
You can do this with logical indexing. For example: % test array A = randi([0 1],5,5) newvalue = 12; % value to substitute ...

4 years ago | 1

Answered
I want to make translation for this shape in binary image inside dictionary why when I try to move the center of the shape to point more than 1 this shape go out image frame?
Not knowing the details of what you're trying to really do, this essentially replicates the behavior, but using IPT tools. It's...

4 years ago | 0

Answered
converting a .tif image to a .tiff image
Both are TIFF files. That said, TIFF is a very flexible format and it's used for a wide array of things across many technical d...

4 years ago | 0

Answered
How do I save the original image jpg from figure for colormap?
A few things. Imwrite doesn't support indexed outputs for JPG files, so if you're trying to save the output as an indexed ima...

4 years ago | 0

Answered
How can I split an hsv image into separate h,s,v components?
Since R2018b, you can also use imsplit(). Imsplit will work on any multichannel image. % you can split an RGB image into its c...

4 years ago | 0

Answered
How to shift the matrix values by a specified function?
You mean something like this? % straight road xlim = 0:0.5:20; ylim = -10:0.125:10; [xr,yr] = meshgrid(xlim,ylim); ylim2 ...

4 years ago | 1

| accepted

Answered
Getting the coefficients of a function in Matlab syms
Try syms a b f = expand((a+b)^2) c = coeffs(f) % if you want a symbolic result c = double(c) % if you want a numeric result

4 years ago | 0

Answered
Variation of color hue over time for multiple images
Here is an example. You'll need to adapt it. % get test images numframes = 6; instack = cell(numframes,1); for f = 1:numfra...

4 years ago | 1

| accepted

Answered
Expanding a function in Matlab
Using symbolic tools: syms a b f = expand((a+b)^2) Your approach would ostensibly return a number because you're treating c...

4 years ago | 0

| accepted

Answered
Plotting multivariable function given a range of x and y to be plotted at given values of dependent var Z
If you're having trouble getting results closer to the singularity, that's because the value of z at the corner is NaN. Z is ge...

4 years ago | 0

| accepted

Answered
Calculate specified area for multiple circle
For the simple case where all circles are identical and the distance between centers is equal to the radius: R = 70.7; % in wha...

4 years ago | 0

Answered
labeling data sections on a graph
Consider the example: [x,~,z] = peaks(100); x = x(1,:); z = z(50,:); plot(x,z) labels = {'dip 1','bump 1','bump 2'}; t...

4 years ago | 0

Answered
Call to Extract Contents from Cell Array not Equal to Value in Cell Array
Oof. I didn't expect this. Can you find the tiny change I made here (other than line wrapping)? offY1 = {offsetY1:size(I1,1) ...

4 years ago | 1

Load more