Answered
Audio to Image Conversion
What are n and m? Is either greater than 65500? Should it be? I don't know if using factor() this way is really doing what y...

5 years ago | 0

| accepted

Answered
Rescale 8-bit grayscale image
Here's a start: inpict = imread('cameraman.tif'); inrange = [64 126; 127 230]; outrange = [0 120; 151 255]; % you sure you ...

5 years ago | 1

Answered
Create a surface from several 1D plots
Something like this: % so you have a vector for x x = linspace(0,1,10); % and a bunch of vectors for z z1 = x.^1; z2 = x.^2...

5 years ago | 0

| accepted

Answered
Applying a circular mask to an image
There are other posts about how to composite two images (or an image and a flat BG) https://www.mathworks.com/matlabcentral/ans...

5 years ago | 0

| accepted

Answered
Given a matrix of n rows and 2 columns containing the xOy coordinates of n points. Find two points with distance and return the row index of those two points
Consider: n = 10; % number of points d = 7; % distance to match P = 10*rand(n,2); % example point list D = sqrt((P(:,1)-...

5 years ago | 0

Answered
Why didn't I find the same answer?
b and B are not the same. They are conjugate. B=-(-1)^(alpha-1)*(1/s^2)^(alpha); In this case (alpha-1) does not equal 0.7. ...

5 years ago | 0

| accepted

Answered
Index in position 2 exceeds array bounds (must not exceed 1) ?
Nothing in this code guarantees that the size of b and c are identical to the size of a. If they aren't the same size, you will...

5 years ago | 0

Answered
How to fix "error using class. Not enough input arguments"?
You had probably shadowed the function class() with some variable by the same name -- which is something you should avoid. wh...

5 years ago | 0

Answered
How do I insert a variable value in legend of a plot?
There are a bunch of examples around. The sidebar shows some. Here are some others: https://www.mathworks.com/matlabcentral/a...

5 years ago | 0

Answered
How to apply Gaussian filter with for loop without imnoise?
Replicating the gaussian noise functionality of imnoise() does not require any loops. If someone insists that you need to use l...

5 years ago | 1

| accepted

Answered
how to do Image translation
blef. A = im2double(imread('cameraman.tif')); s = imsize(A,3); % nonstandard; see attached file B = zeros([s 4]); for f = ...

5 years ago | 0

Answered
Plot multiple rectangles from set of points
Is this what you mean? C = [1 1; 2 4; 3 2]; % center locations [x y] for c = 1:size(C,1) r = 0.5+rand(1,2)*0.5; pl...

5 years ago | 0

| accepted

Answered
How to remove contour line in filled contour plot?
Hmm. I didn't think about that. I don't know that it can be done with contourf(). % make a simple linear ramp that cycles [x...

5 years ago | 1

| accepted

Answered
for loop/periodic implementation for number or arrays?
If I'm reading this right... Let's say you have an array A: A = randi([-5 110],5,3) % random test array allowedrange = [1 1...

5 years ago | 1

Answered
Using bag of words function
If you just want the word frequency table: filename = 'SampleText.txt'; str = fileread(filename); words = regexp(lower(str),'...

5 years ago | 0

Answered
Create Matrix using only zeros and ones
How about an example using concatenation only. No arithmetic composition or array indexing. e = ones(2); c = zeros(3,2); n =...

5 years ago | 0

Answered
How to read and scan a text file
Attached is an example file: inputfile = fileread('SampleText.txt'); % make sure file exists? Number_of_vowels = vowelcounts...

5 years ago | 1

| accepted

Answered
need help to plot function contain condition 'equal '
There are some problems here. Let's start with the solution. I adjusted the parameters so it looks more like the picture, but ...

5 years ago | 0

| accepted

Answered
making a folded picture
If you want to edge-concatenate two images of the same height, you don't need to waste your time with imfuse. s = [s j]; If th...

5 years ago | 0

| accepted

Answered
How display different blocks of the images in one figure?
If you want them tiled as shown, then you're going to have to reassemble them into one image. A = imread('cameraman.tif'); %...

5 years ago | 0

Answered
How can I plot circular colormap for 0-24 hour phase?
If you want a circular colormap, why are you using jet? Just use hsv(). imshow(repmat(permute(hsv(64),[1 3 2]),[1 64 1])) ...

5 years ago | 0

| accepted

Answered
Extract coordinate data from plotm figure?
Something like this: F = openfig('sample_map.fig'); h = findobj(F,'type','surface'); x=get(h,'xdata'); y=get(h,'ydata'); z=...

5 years ago | 0

| accepted

Answered
Populating matrix with coordinates of each element
For your example using row-wise linear indexing: s = [5 10]; % output size reshape(1:prod(s),s(2),s(1)).' Obviously, you'd ch...

5 years ago | 0

| accepted

Answered
Plot function not working as expected - different graph to the one in cftool
You weren't far off amp_A=[0.02195; 0.02202;0.02208;0.02223;0.02237;0.0254;0.02305;0.02197;0.02198;0.0217;0.02205;0.02217]; om...

5 years ago | 0

| accepted

Answered
trying to understand why I get 2.2204e-16 rather than 0
Simply put, the assumption that both x and y are equal to the same value is incorrect. One or both have accumulated rounding er...

5 years ago | 1

Answered
Any way to use images in several data arrays to create HDR images?
Start here: https://www.mathworks.com/help/images/ref/makehdr.html A web search for 'matlab hdr' should turn up many related i...

5 years ago | 1

| accepted

Answered
im2uint16 makes images binary (to convert images from double to uint16)
The image returned by imadjust() is of class 'double', but it's scaled as if it were still uint16. Im2uint16() will assume the ...

5 years ago | 0

| accepted

Answered
How is modeled the more short time this loop?
I bet this can be simplified further, but here. l = 4; R = rand(1,l); W = zeros(1,l); for k = 1:l W(k) = sum(R(1:l-k+1) ...

5 years ago | 0

| accepted

Answered
How to combine two images in specific position for binary masking?
The images you're importing aren't the expected image height. If you divide by two, they won't tile correctly. If you do what ...

5 years ago | 0

| accepted

Answered
Does imtool work on an image of type double?
How did you convert the image to double? If you did something like A = imread('mypicture.jpg'); A = double(A); then the imag...

5 years ago | 0

Load more