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

alrededor de 7 años hace | 2

| aceptada

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

alrededor de 7 años hace | 0

Respondida
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

alrededor de 7 años hace | 1

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 1

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

alrededor de 7 años hace | 2

| aceptada

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

alrededor de 7 años hace | 3

| aceptada

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 1

| aceptada

Respondida
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(:)];

alrededor de 7 años hace | 1

Respondida
Intensity profile of an image
improfile should work

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 1

| aceptada

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 1

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 1

| aceptada

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

alrededor de 7 años hace | 3

| aceptada

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

alrededor de 7 años hace | 1

| aceptada

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 0

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 0

| aceptada

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

alrededor de 7 años hace | 4

| aceptada

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

alrededor de 7 años hace | 0

Cargar más