Answered
Joining every eight columns in a matrix
Although it might visually be joining characters, that is not necessarily what you need. The code below should be one of the fas...

7 years ago | 0

| accepted

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

7 years ago | 2

| accepted

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

7 years ago | 0

Answered
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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 1

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

7 years ago | 2

| accepted

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

7 years ago | 3

| accepted

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

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 1

Answered
Intensity profile of an image
improfile should work

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 3

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 4

| accepted

Load more