Answered
Need help time stepping this system
I guess, the problem is that you overwrite x, y and z in each iteration: x = zeros(length(t),1); y = zeros(length(t),1);...

8 years ago | 1

| accepted

Answered
Change a value after a maximum five-consecutive column of zero
A = [1 0 0 -1 0 0 0 0 1 0 0 -1 0 0 1; ... 0 -1 0 0 0 0 0 1 -1 0 1 0 0 1 0]; [s1, s2] = size(A); Av = reshape(A...

8 years ago | 1

Answered
issues with rotating and translating matrix for 2D simulation
The translation must be combined with the former rotation. Replace: g.Matrix = makehgtform('translate',pt1 + t2*(pt2-pt1));...

8 years ago | 0

| accepted

Answered
How do I split the file path into just a file name? Matlab GUI
I have no idea what "When the box is unchecked" means. Listboxes cannot be checked or unchecked. I guess you have a listbox with...

8 years ago | 0

| accepted

Answered
find indices of row subsets
function ind = item2ind(item, t); maxRun = length(t) + 1; [T , TI] = accumsort(t, maxRun); ind = zeros(size(it...

8 years ago | 1

Answered
why I cannot list specify files with function dir
Guillaume is right: You have created a file called '*.jpg'. This is not possible under Windows with standard tools, but you can ...

8 years ago | 0

| accepted

Answered
How do i plot the x-y coordinates on the same graph for all the 500 sheets of excel file?
Create an axes and enable that existing objects are not overwritten. Then import the data in a loop and draw them: ax = axe...

8 years ago | 0

Answered
How do i separate running data?
The problem is not easy. The posted file contains these values in Data{2}: <</matlabcentral/answers/uploaded_files/116773/Cap...

8 years ago | 0

Answered
Removing consecutive zeros of a certain length
What is the "duration"? The number of consecutive elements or does the "time" in the first column matter? If elements are mea...

8 years ago | 0

Answered
Children option with matlab 2013
The numbers you see in e.g. R2013 are the wanted graphic handles. Before R2014a, which introduced the new graphics library calle...

8 years ago | 1

| accepted

Answered
High CPU usage when running "soundsc" or "play"
My former comment vanished, when your message was moved from the section for answers to the comments. I wrote: And what do yo...

8 years ago | 1

| accepted

Answered
How do you convert a 4D logical matrix to a 3D uint8 matrix
With a Matlab version >= R2016b: x = 100; y = 200; Img4D = (randi([0,1], x,y,3,8) == 1); Img3D = uint8(sum(Img4D ....

8 years ago | 0

| accepted

Answered
How to apply a format to one column only using fprintf?
The question is not really clear to me. Perhaps you want: x = [1.000 2.000] y = [0.89 0.98] fprintf('%g %g\n', [x; y]...

8 years ago | 1

| accepted

Answered
fatal error on startup
Download it again. If this does not help, post any details: Operating System, error log, ... Send these details to MathWorks usi...

8 years ago | 0

Answered
What's the principle of function "inpolygon"?
You find a reference to the algorithm in the comments: % The algorithm is similar to that described in the following re...

8 years ago | 0

| accepted

Answered
What is the precision of *.datenum, which dir() returns
The precision of the date depends on the file system. Linux' ext4 file system supports nanoseconds, NTFS uses 100 nanoseconds, F...

8 years ago | 1

Answered
Why is this for loop not producing unique values for each index of the calculated matrix?
Why do you assume, that the output is wrong? Numerically it is correct and Matlab calculates exactly what it is instructed to do...

8 years ago | 2

| accepted

Answered
How can I make my code faster by vectorizing it?
Here is a version with a sparse matrix - without a remarkable speedup: function PS = tPj_PS(lambda_R,lambda_A,mu_1,mu_2,n) ...

8 years ago | 1

Answered
how to calculate rms of an audio file
Signal = audioread(FileName); RMS = sqrt(mean(Signal.^2, 1))

8 years ago | 2

| accepted

Answered
How to complete fill between 2 lines.
X = [p(:).', fliplr(f(:).')]; Y = [Prof, fliplr(Prof)]; fill(X, Y, 'm')

8 years ago | 0

| accepted

Answered
Can somebody help me to solve this error? It say Error using feval.
Open your file |DM.m| in the editor. You see red marks on the right side, which show the errors directly: % Line 285: if...

8 years ago | 0

Answered
Define an ellipse with a given angle and find if a point lies inside its boundaries
The most easy approach is defining the ellipse by the two foci F1 and F2. Then an ellipse is the set of points, which sum of dis...

8 years ago | 1

| accepted

Answered
Simpson's rule implementation
The number of steps does not matter, if the function is linear: f=@(x) (3+x.^1/2) |x.^1/2| is |(x .^ 1) / 2|, which is t...

8 years ago | 0

Answered
close all "non-existent field 'view'" error
It seems like one of the figures has a failing CloseRequestFcn. Try to identify it by using the debugger. Type this in the comma...

8 years ago | 0

Answered
How can I apply my idea about doppler effect to the sound file?
The question contains strange details: matlab converts analog sound file to digital file which contain frequency informati...

8 years ago | 0

| accepted

Answered
Combine graphs into one?
tspan = 0:0.5:15; [t1, y1] = ode45(@f1, tspan, [1, 0]); [t2, y2] = ode45(@f2, tspan, [1, 0]); [t3, y3] = ode45(@f3, t...

8 years ago | 0

Answered
How can I change value of array?
Maybe: B = numel(A):-1:1 if the array A is sorted already. Otehrwise: [~, B] = sort(A, 'ascend')

8 years ago | 0

| accepted

Answered
How to extract whole column from a array contains strings in the same size (date format)
a = datetime({'30-Dec-0117 12:00:00' '30-Dec-0117 18:00:00' '31-Dec-0117 00:00:00' ...

8 years ago | 0

Load more