Beantwortet
How do I make a section of a function runs only one time?
One way might be to use persistent variables. function out = myfunction(a,b,c) persistent S data_mdl if isempty(S) ...

etwa 4 Jahre vor | 1

Beantwortet
The image changes color and position
I'm not sure why the image is upside-down, but the reason it's yellow is probably because it's a monochrome (single-channel) ima...

etwa 4 Jahre vor | 1

Beantwortet
different file name in saving images
In whatever loop you're using, create the filename something like this: k = 10 % whatever number you need sprintf('Y_%03dmm.bm...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Transparency value in colormap
Colormaps and colorbars do not support RGBA formats (as far as I know). Transparency is handled separately by the AlphaData pro...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Create a vector using the even elements of another.
If I understand the question correctly: b = 10; N = 100; j = 1:2:N+1; del_y = b/N; i = 1:1:N+1; y_pos = -(b/2) + (i - 1)...

etwa 4 Jahre vor | 0

Beantwortet
how to set decimal value to my matrix image index?
You have some problems with your code that's causing the result to not have the number of gray levels you expect. I think imsho...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to generate a map of European countries coloured according to a vector of positive and negative values?
This should work. Note that the placeholder data isn't even integer-valued. % country names cou_nam = {'Belgium', 'Bulgaria',...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Plot conflicts with mathematical calculation
There are two poles. The function is undefined when the denominator is zero. The only reason it looks like the extrema vary is...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Plot two figures simultaneously
You can try something like this. There's some lag in between figure updates, but it's a start. % Data Layup Layup = [90 0 0 4...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
how to find position of an element in a matrix which is present in another matrix?
a=[0.74 0.71 0.604 0.47 0.59 0.58 0.75]; b=[0.604 0.75]; % get the index of matches % ainb are the indices of elements of a...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Creating a blur brush tool for images
Doing the interactive painting routine sounds like it's going to be laggy and frustrating. That's one of the things I've long...

etwa 4 Jahre vor | 0

Beantwortet
median filter on a region of interest
Just filter the whole image and then compose the two using a mask that defines the ROI. A = imread('cameraman.tif'); % make ...

etwa 4 Jahre vor | 0

Beantwortet
I am trying to plot multiple data sets on one one diagram. When I use the plot function, I am not getting any data plots.
p02p01 is a scalar, so there's not really anything to plot. I imagine that's supposed to be a vector, but you're just overwriti...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Can someone please help me out with this MATLAB code. It is giving error "INDEX EXCEEDS THE NUMBER OF ARRAYS_ INDEX MUST NOT EXCEED 1" ON LINE 69
thetaa1t and thetaa2t are initialized as scalars thetaa1t((1)) = 0 ; thetaa2t((1)) = 0 ; I imagine you're trying to grow them...

etwa 4 Jahre vor | 0

Beantwortet
2 unknowns in matching datasets
I'm sure there are other ways, but: load datasett.mat % omit nans nanmask = ~(isnan(Y1) | isnan(Y2) | isnan(Y3)); Y1 = Y1(...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How do I convert my RGB image to grayscale without using the Image Processing Toolbox?
EDIT: It's worth noting that as of R2014b, rgb2gray() no longer requires IPT. Still, if you're writing code for others and inte...

etwa 4 Jahre vor | 0

Beantwortet
Change RGB image to gray without rgb2gray function
Assuming that the input is an RGB image and that the intended grayscale representation is luma and not something else: % get an...

etwa 4 Jahre vor | 0

Beantwortet
i need negative image
It's best to avoid writing your code around unchecked assumptions of array class. If you have Image Processing Toolbox, imcompl...

etwa 4 Jahre vor | 1

Beantwortet
Rotate an Ellipsoid towards a point
Try this: theta = linspace(0, pi, 25); phi = linspace(0, 2*pi, 25) ; x = 10*sin(theta)'*cos(phi); y = 1*sin(theta)'*sin(phi)...

etwa 4 Jahre vor | 0

Beantwortet
Display original and processed image simultaneously in different UIAxes in App Designer
The images appear alternately because that's what the code plainly does. It shows one image, waits, shows another. It doesn't ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How can the image be like this?
This is one way: A = imread('peppers.png'); imshow(A) B = zeros(size(A),class(A)); % black image B(100:250,200:350,:) = A(10...

etwa 4 Jahre vor | 1

Beantwortet
Change for loop to while loop.
If you want to make things more complicated, you can: n = 5; %input ("Input a number: "); fprintf("\nOdd number: "); i = 1;...

etwa 4 Jahre vor | 0

Beantwortet
Creating a contour plot with three row vectors
I answered a similar question recently. https://www.mathworks.com/matlabcentral/answers/1693130-how-to-use-a-contour-between-...

etwa 4 Jahre vor | 2

| akzeptiert

Beantwortet
I'm trying to operate on each element of a row vector individually but unable to do so, as each element is containing a vector within itself.
I think what you're asking is to get the number of elements for each vector within the cell array. You can do that either with ...

etwa 4 Jahre vor | 0

Beantwortet
Check if a binary image is within a particular binary area
I'm assuming your images are the same size, but contain objects of differing size. The intersection of two binary images A and ...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
How do I draw overlapping circles wich change color?
Here's one way: % image setup sz = [600 600]; % image size cim = sz/2; % [y x] center of image r1 = 100; % radius of small c...

etwa 4 Jahre vor | 0

Beantwortet
Help on while loop to make user enter an accepted value
pC can't be <0 && >100 This should fix the issue and simplify things pC = -1; % initialize while (~isnumeric(pC) || (pC<...

etwa 4 Jahre vor | 1

Beantwortet
Code for making a reddish image from an RGB image
I've answered a couple very similar-sounding questions recently: How to make image "yellowish"? (explaining 'screen' blend, alt...

etwa 4 Jahre vor | 0

Beantwortet
Why is my plot empty?
The plot doesn't display because all of the output values (except for tt = 0) are NaN. L is a relatively large number ~2E6, s...

etwa 4 Jahre vor | 0

Beantwortet
How to "circularize" a 1-D plot into a 2-D image
Depending on what you need, this may be a start. % define TF curve tfr = [0 1.3 4]; tfz = [1 1 0.2]; % array setup maxxy = ...

etwa 4 Jahre vor | 0

Mehr laden