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

23 days ago | 0

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

25 days ago | 0

| accepted

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

25 days ago | 0

| accepted

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

25 days ago | 1

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

25 days ago | 0

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

25 days ago | 0

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

25 days ago | 1

| accepted

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

25 days ago | 0

| accepted

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

25 days ago | 0

| accepted

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

26 days ago | 0

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

26 days ago | 0

| accepted

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

26 days ago | 0

| accepted

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

27 days ago | 0

| accepted

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

27 days ago | 0

| accepted

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

27 days ago | 1

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

27 days ago | 1

| accepted

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

27 days ago | 0

| accepted

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

27 days ago | 0

| accepted

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

29 days ago | 0

| accepted

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

29 days ago | 0

How to replace array elements in specified indexes with another array?
It can be done, something like this: https://www.mathworks.com/matlabcentral/answers/829183-how-to-remove-outlier-of-time-serie...

29 days ago | 0

| accepted

What operations/functions can I use to speed up these nested for loops?
Try this: A = im2double(rgb2gray(imread('eyetest.png'))); avg = 10; sig = 20; % create gaussian filter r = sig*5; xx =...

29 days ago | 0

| accepted

How do I reduce the number of points in a plotted trace?
I don't know of any simple means to convert an image into a minimal line drawing. Features like the intersection of the facial ...

1 month ago | 1

| accepted

Why do I get this error while plotting this?
errorbar() doesn't support datetime inputs. You'll end up needing to avoid that, which might complicate things a bit: https://...

1 month ago | 0

Stretch a plot while keeping area under same
If you scale the curve in the X direction by a factor of 2, then scale the curve in Y by a factor of 1/2. X = 0:100; % linear...

1 month ago | 0

TIFF different than BMP in image compression
I'm assuming you're asking about picking a format when writing an image file. The answer depends, but generally, TIFF would be ...

1 month ago | 0

How to split matrix into arrays without loop.
You should be able to just do: PL2 = permute(reshape(PL.',3,[],8),[2 1 3]); to get the same result. Bear in mind that this as...

1 month ago | 0

| accepted

How can I generate a vector that corresponds to counted occurence data?
Maybe something like this will work: A = [5 3 1]; n = [2 4 6]; B = repelem(A,n)

1 month ago | 0

| accepted