Risposto
how can i find mean of a plotted graph?
The thing you are asking is slightly different from what is generally meant with 'mean'. The code below shows two interpretation...

circa 7 anni fa | 2

| accettato

Risposto
how to run same command for sequence of files
Use a loop. Using numbered variables is generally a bad idea. Consider using an array to store everything. If you use the same n...

circa 7 anni fa | 0

Risposto
to print following pattern
You mean like this? for k=1:9 a=str2double(char('0'+(1:k))); b=a*8+k; fprintf('%d x 8 + %d = %d\n',a,k,b) end

circa 7 anni fa | 1

| accettato

Risposto
Insert blank/NaN rows in a column
This example should work. Don't forget to add NaN values to your x-parameter as well. Alternatively, you could plot them as sep...

circa 7 anni fa | 0

| accettato

Risposto
create columns with for loop
This should help you solve it: Rows_I_need=[500, 1000, 2500]; %generate random array as input array=randi(3,4000,1); %get ...

circa 7 anni fa | 0

| accettato

Risposto
How can i extract numerical intensity values from an image
You can make use of the fact that an image is already a matrix. Instead of ndgrid (as used in this code), you could also conside...

circa 7 anni fa | 0

| accettato

Risposto
Calculate the volume of a CAD part
An example to work with would make this easier to answer. The bounding box should be fairly straightforward: just take the min ...

circa 7 anni fa | 0

Risposto
Using loop instead of hardcoding
Please post your code as code instead of a picture. What exact function are you using? The only midpoint function I can find in ...

circa 7 anni fa | 0

Risposto
Plot a my own created function
Your output is sometimes complex. You should fix this in your function, but you can also apply a quick fix here: fplot(@(Lambda...

circa 7 anni fa | 0

| accettato

Risposto
Find the earliest common date and indicator of two date vectors.
This answer assumes you have your dates in a datetime format. If you don't it should be relatively easy to convert to it. If you...

circa 7 anni fa | 1

Risposto
"patch" command error
I suspect you generated the vertex IDs in a programming language that is zero-indexed, instead of one-indexed. If that is the ca...

circa 7 anni fa | 2

| accettato

Risposto
Figure editing shortcut missing
Edit: You can open the plot tools with the plottools function. You can probably add this as a custom button, but otherwise the ...

circa 7 anni fa | 3

| accettato

Risposto
Presenting 48 images in 4 conditions where each image is presented only once?
Do you mean something like this? %generate some empty structs for testing %(replace by appropriate calls to the dir function) ...

circa 7 anni fa | 0

Risposto
Will m files work that were made in matlab R2018a work in matlab R2017b?
You can check the release notes to see if you're using functions that were introduced in R2018a, but I suspect from your descrip...

circa 7 anni fa | 1

| accettato

Risposto
How to convert row and column data into x,y,flag format?
BW1=[0 0 1;1 1 0];%example matrix [Y,X]=ndgrid(1:size(BW1,1),1:size(BW1,2)); data=[X(:) Y(:) BW1(:)];

circa 7 anni fa | 1

Risposto
Intensity profile of an image
improfile should work

circa 7 anni fa | 0

Risposto
How to append data from multiple runs of script without overwriting previous data.
Use one of the append options from fopen: 'r' Open file for reading. 'w' Open or create new file for writing. Discard existing...

circa 7 anni fa | 0

| accettato

Risposto
need help the mean of this code
This is horrible code. I would strongly suggest not using it. However, it should be easy to see what is happening if you go thr...

circa 7 anni fa | 1

| accettato

Risposto
Get time/date online
Slightly expanding the above solution by Vincent, the attached code should work on all Matlab releases, as well as GNU Octave. I...

circa 7 anni fa | 0

Risposto
evalin('caller','mfilename') does not work.
Depending on your release you can get the complete names including the path from dbstack (in v6.5 you couldn't, but already sinc...

circa 7 anni fa | 1

| accettato

Risposto
How do i make figures plotted in Matlab to appear in a chronological order?
You can bring focus to a figure with the figure function: h=struct; h.f=zeros(1,5);%will contain the handles to the figures f...

circa 7 anni fa | 0

| accettato

Risposto
How do i load a file automatically in a particular folder just by a part of the filename?
folder='C:\Path\To\Your\Data'; list_of_files=dir(fullfile(folder,'Annot*')); %remove any matching folders list_of_files([li...

circa 7 anni fa | 1

| accettato

Risposto
An accumulating matrix to be reset when the limit value is reached, the value being reset must be moved to another matrix
This should do the trick. Note that you should use numel to count the number of elements, not length, which is just doing max(si...

circa 7 anni fa | 3

| accettato

Risposto
Calling a callback function in GUI
Your problem is not taking into account the full potential of callbacks. You throw away the handle to the object you're using. Y...

circa 7 anni fa | 1

| accettato

Risposto
passing variable from one callback to another callback in gui
Store the value of k inside your guidata struct.

circa 7 anni fa | 0

Risposto
could anyone help me how to check the size of bigger matrix and run the code accordingly.
This code should work: if numel(A) > numel(B) A_=A;B_=B; else A_=B;B_=A; end [jj,kk]=size(A_) [jjj,kk...

circa 7 anni fa | 0

Risposto
Intergral calculation for data vector
You define your t vector only after you use it in trapz. But more importantly, your figure looks like you don't mean an integrat...

circa 7 anni fa | 0

| accettato

Risposto
change the xticklabel with date format
I don't know if there is a control for the non-marked ticks, but maybe box does something you like. For the ticks, you should b...

circa 7 anni fa | 0

| accettato

Risposto
Extract rows from a matrix using time ranges
I'm going to assume your last element of B should be 1 larger, because then your C makes sense. The code below should do what yo...

circa 7 anni fa | 4

| accettato

Risposto
How to draw lines with the points obtained from getpts
You're getting 4 points, which you then plot with the line function. The name might sound like it only produces straight lines f...

circa 7 anni fa | 0

Carica altro