Risposto
How to find the local mean of an image?
The fastest way to get a local average is to do a convolution with a flat structuring element: %load example image A=imread(['...

circa 7 anni fa | 0

| accettato

Risposto
How to calculate the shortest distance between points and a line?
You can use the point_to_line_distance function.

circa 7 anni fa | 0

| accettato

Risposto
Can isstrprop search for 2 properties?
I would convert to double type and use ismember to check if all characters are allowed. Alternatively you could just convert ...

circa 7 anni fa | 1

Risposto
EULER'S METHOD GUI HELP
You are using str2num (which you shouldn't), and you are setting a numeric vector as the string property. You may need to consid...

circa 7 anni fa | 1

Risposto
How do i create checkboxes near each plots in a subplot window ?
You can use uicontrol('Style','checkbox').

circa 7 anni fa | 0

| accettato

Risposto
Matching based on working days
You can use the weekday function. You can easily adapt the function below to apply specific shifts. A=datenum({'2019-04-07','20...

circa 7 anni fa | 0

| accettato

Risposto
Two differente program to write in the same place
This is just a simple concatenation: function output=xx output=[main transfer]; end function output=main output=rand(19,6);...

circa 7 anni fa | 0

| accettato

Risposto
help with this 02 questions please
For question 1: link For question 2: you can create a CloseRequestFcn that also closes the secondary app link.

circa 7 anni fa | 0

| accettato

Risposto
Memory issue to create 4D array
The amount of data is probably huge, is not pre-allocated and will probably not fit in memory. Have you calculated an estimated ...

circa 7 anni fa | 0

Risposto
Finding pythagoras triples when only c is known
You are quite close. The code below contains some optimization in terms of selection of values to check, and the check is modifi...

circa 7 anni fa | 1

Risposto
how do i read a folder database into matlab
Use uigetdir to ask the user for a folder, then use dir to get the list of files inside that folder, then use a for loop to load...

oltre 7 anni fa | 0

| accettato

Risposto
if statement not working
What you probably think should happen is in the code below, however, there is a better way. A = [5;5;5;3;3;2]; B = [10;4;10;10...

oltre 7 anni fa | 1

| accettato

Risposto
How can I change from Cell to Double and writing in many lines
The code below should do what you want. %generate input A=cellfun(@(x) {x+rand(6,6)},num2cell(1:19)'); %convert the cell co...

oltre 7 anni fa | 0

| accettato

Risposto
Round to Nearest Multiple of 4.
a=45; k=4; b=k*round(a/k);

oltre 7 anni fa | 6

| accettato

Risposto
sequential file reading and operations
That is not how the textscan function works. You should read the documentation for the functions you are using. figure(1) root...

oltre 7 anni fa | 0

| accettato

Risposto
code with the same function
There are two easy options: a loop and a histogram: %for loop method: data = fileread('mytextfile.txt'); letters='ABCDEFGHIJK...

oltre 7 anni fa | 1

Risposto
Test poker hand by using edit text boxes GUI
What I would do is first of all change your value convention to something more standard (Ace=1,Jack=11,Queen=12,King=13) or keep...

oltre 7 anni fa | 0

| accettato

Risposto
Game of GUI matrix dimensions must agree
Because a char array is an array of values in Matlab, you are trying to compare an array of values to another array. If what you...

oltre 7 anni fa | 0

| accettato

Risposto
Change function name everywhere
If you change the name in the function declaration, the auto-change should work, just as with variable names inside the same sco...

oltre 7 anni fa | 3

Risposto
How to Create Multidimensional table in for loop
A bold guess based on your commented code: Trajectory =1:15; TrajDetail = zeros(1,4,15); for i = 1:length(Trajectory) TS...

oltre 7 anni fa | 0

| accettato

Risposto
could anyone hep me to clear my doubt
Because inf is the extreme, you can use it to find the next value in your data. As an example, the code below finds the maximum ...

oltre 7 anni fa | 0

Risposto
How do I add data to multiple figure windows in one loop?
Use explicit handles: fig4=figure(4); fig5=figure(5); %'NextPlot','add' is equivalent to hold('on') ax4=axes('Parent',fig4,'...

oltre 7 anni fa | 0

| accettato

Risposto
How to unit (combine) logical array "along" it's 3rd dimension or How to find logical OR betwen all pages along 3rd dim of 3D array
As Guillaume mentions, you should be using this: any(L,3) instead of my original answer sum(L,3)>0 (Even if the result shoul...

oltre 7 anni fa | 0

| accettato

Risposto
How to avoid evalin?
You can solve it this time by loading into a struct: S=load('GivenFile.mat'); fn=fieldnames(S); for n=1:numel(fn) tempVa...

oltre 7 anni fa | 0

| accettato

Risposto
App Designer button callback
You can force a graphics update with drawnow, or by introducing a small pause (in general I see people using pause(0.01) or a si...

oltre 7 anni fa | 0

| accettato

Risposto
How to fast process a calculation within a matrix without using a loop?
Yes, use the power of array processing in Matlab: B=10.^-A;

oltre 7 anni fa | 0

| accettato

Risposto
How can i know what is the n when the nth is the smallest or biggest
If you mean the index of the minimum value, the documentation for the min function shows you how to find the index. A different ...

oltre 7 anni fa | 0

| accettato

Risposto
Entering default values in a function.
If you only want to specify n, you should only provide that as the input: n=4; [counter,ratio,x,TOL,ROC]=FixedPointIteration(n...

oltre 7 anni fa | 0

Risposto
Input data using GUI
Have a look at the code below, read the documentation for every function that you don't know and try to understand the flow of t...

oltre 7 anni fa | 1

| accettato

Risposto
Mean of elements of a vector
Use a convolution. conv(data,[0.5 0.5]) should be a good start.

oltre 7 anni fa | 1

Carica altro