Answered
Cell Mode and how to use it in Debugging.
There is a bit of confusing nomenclature regarding this feature. Futhermore the feature has evolved over the years. I found this...

7 months ago | 0

Question


How to find package functions that are shadowed?
I'm missing something. It is possible to have several package functions with identical fully qualified names, e.g. p1.test, on ...

8 months ago | 0 answers | 0

0

answers

Answered
Create matrix using the array as index
Try this M = zeros(5,5); a = [2,2,1,0,3]; for jj = 1:5 M(a(jj)+1,jj)=1; end disp(M)

8 months ago | 1

Answered
Import large csv as datastore with formatting errors
Comment out the offending rows open files while not( feof(fid) ) chr = fgetl(fid); is_ok = analyse_row( chr ); ...

8 months ago | 1

| accepted

Answered
I am getting "Undefined function or variable" for an existing variable.
Run this modified script from the command window whos par* run QuickSIN_parameters.m % load experiment parameters whos par* ...

8 months ago | 0

Question


R2021b: The Run Section tool in the Editor has been removed
I use the Run Section tool all the time and was surprised to read in the R2021b release notes that it's been removed. Is it repl...

8 months ago | 2 answers | 0

2

answers

Answered
how to delete repeated rows in a table?
Test this %% M = [518460 3.322; 518460 -12.984; 518520 3.798; 518520 -10.28; 518580 7.763; 518580 16.851; 518640 5.959; 522225...

8 months ago | 1

| accepted

Answered
how to find a float number
find( abs( y7 -(-0.3340) ) < tol ) You choose tol. See eps - Floating-point relative accuracy

8 months ago | 0

| accepted

Answered
Tiny discussion on good practices in object oriented programming (OOP) through a simple example
"[...]titles of decent books for non-programmers" AFAIK: There is no book on object oriented design and programming with Matlab...

8 months ago | 0

Question


Is the Abstract keyword needed to make a method abstract?
Is this correct Matlab syntax classdef MyClass methods outarg = my_method( this, inarg ); end end R2018b a...

8 months ago | 1 answer | 0

1

answer

Answered
How to speed up the while loop?
You didn't test the code before uploading! I modified the input lines z = 1; % input('Enter zeta, z = '); w = 1; % input('Ent...

8 months ago | 0

| accepted

Answered
Matrix dimensions must agree.
Because (jy12) is 400x400 and omega is 200x200

8 months ago | 0

Answered
I got stuck with a loop after the value gets to NaN
The values of xr and yr do not converge to a solution that you expect. xr goes to zero and yr goes to "infinity". >> Newton_Ra...

9 months ago | 1

| accepted

Answered
Why the ouput of disp input function become looping?
The expected output is repeated a zillion times, because yfit is a vector with a zillion elements >> whos yfit Name Si...

9 months ago | 0

| accepted

Answered
Split every matrix in cell and make it into different cell
One way %% M = ones(32,32,2,3); % Sample data (20000 replaced by 3) C = mat2cell( M, 32, 32, 2, ones(1,3) ); %% C = sque...

9 months ago | 0

| accepted

Answered
How to convert 32x32x2x20000 into 20000x1 cell array?
A mat2cell example %% M = ones(32,32,2,6); % Sample data (20000 replaced by 6) C = mat2cell( M, 32, 32, 2, ones(1,6) ); %...

9 months ago | 0

| accepted

Answered
Why is my function not working?
The function must be at the end of the m-file. It's a local file in a script. (Or you can have the script and the function in tw...

9 months ago | 0

Answered
I cannot access the comment pane of the MathWorks Blogs. Am I the only one?
Tech support has reproduced the issue and suggests two work arounds Incognito mode in Chrome Clearing cache or cookies "Remo...

9 months ago | 0

Solved


Finding sum of even numbers in a vector.
Find the sum of all the even numbers present in the input vector x. Examples: Input x = [1 2 3 4] Output y is 6 Input...

9 months ago

Answered
Do I use the "for loop" correct or efficiently?
Replace the loops by a(1:1800)=50; a(1801:3000)=90; a(3001:3500)=0; to match the figure

9 months ago | 0

| accepted

Answered
Specify nature/type of property
... or something like: classdef meals properties food (1,1) struct = struct( 'type',{'wheat'}, 'calories',{...

9 months ago | 0

Answered
How to understand a datenum date?
A serial date (number) represents time as the number of days (and fraction of days) from January 0, 0000. sdn = now % the fu...

9 months ago | 0

Question


I cannot access the comment pane of the MathWorks Blogs. Am I the only one?
Over the last week I've failed to access the comment pane of the MathWorks Blogs, but for a few short occasions. Does anybody el...

9 months ago | 1 answer | 0

1

answer

Answered
Strings to variable names
First a little exercise %% results = readtable('raw_data.csv'); results(4,:) %% results.Properties.VariableNames{'Sigma'} =...

9 months ago | 1

Answered
How to call a class-specified overloaded version of a function without using an object instance as an argument
"I don't want to define 'sin' as a static method because then sin(myNum) will not automatically invoke the overloaded function" ...

9 months ago | 1

| accepted

Answered
Recursively reversing large vector efficiently
Five ways to flip a row vector. The last one, reversal_v3(), answers your question. Recursion is by two order of magnitude slowe...

9 months ago | 0

Answered
Accessing properties in a class
There is nothing special with the name obj, it's just a name. The assignments in the method, fun1, creates a structure (named o...

10 months ago | 0

Answered
Gang-of-Four Design Patterns in MATLAB
I'm not aware of any "full or partial MATLAB collection" and I've search for it more than once. Googling for "design patterns ...

10 months ago | 1

Answered
How to relocate (left side) the legend in plot ?
Read the documentation on legend() and notice legend(___,'Location',lcn)

10 months ago | 0

| accepted

Answered
Creating charts in Matlab
Yes, see the function, bar( ..., 'stacked' ). However, it lacks the 3D character of the bars.

10 months ago | 1

| accepted

Load more