Réponse apportée
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) ...

environ 4 ans il y a | 1

Réponse apportée
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...

environ 4 ans il y a | 1

Réponse apportée
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...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
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)...

environ 4 ans il y a | 0

Réponse apportée
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...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
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',...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 4 ans il y a | 0

Réponse apportée
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 ...

environ 4 ans il y a | 0

Réponse apportée
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...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 4 ans il y a | 0

Réponse apportée
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(...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 4 ans il y a | 0

Réponse apportée
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...

environ 4 ans il y a | 0

Réponse apportée
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...

environ 4 ans il y a | 1

Réponse apportée
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)...

environ 4 ans il y a | 0

Réponse apportée
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 ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 4 ans il y a | 1

Réponse apportée
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;...

environ 4 ans il y a | 0

Réponse apportée
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-...

environ 4 ans il y a | 2

| A accepté

Réponse apportée
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 ...

environ 4 ans il y a | 0

Réponse apportée
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 ...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 4 ans il y a | 0

Réponse apportée
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<...

environ 4 ans il y a | 1

Réponse apportée
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...

environ 4 ans il y a | 0

Réponse apportée
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...

environ 4 ans il y a | 0

Réponse apportée
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 = ...

environ 4 ans il y a | 0

Charger plus