Answered
using IF and && together
The "why" is because the |&&| operator "short-circuits"; IOW, if the first condition is met so the answer is known from the firs...

9 years ago | 0

| accepted

Answered
How to find value of x for each w in W without using a for loop?
_"... How would I do it without the loop?"_ Call the function with the *vector* argument _w_ and inside the function # Set...

9 years ago | 1

| accepted

Answered
How to plot an array in negative axes
Ah...ok, now I see...presuming the array is assumed to match box boundaries, just define _X,Y_ to match the dimensions you want-...

9 years ago | 1

| accepted

Answered
What is missing from MATLAB?
|TABLE| type needs display format by variable similar to the |DATETIME| object. Having to set global application format is a nu...

9 years ago | 0

Answered
Inner matrix dimensions must agree
That is so excepting when you get to underdamped = exp(-t./T1)*(B1*cos(omega*t.)+B2*sin(omega*t.)); you're trying to mu...

9 years ago | 1

| accepted

Answered
Date format changes at midnight
It's unfortunate the ML time functions aren't more forgiving of such cases. Best I can think of otomh is to either do the fix...

9 years ago | 0

Answered
How can I use datetick with more than x, y, z in input and on Y-axis?
Syntax for |datetick| is datetick(tickaxis) _not_ datetick(wanteddateaxisvariablename) Just need datetick('y...

9 years ago | 0

| accepted

Answered
How to plot a graph for one set of data against two y axes, one a function of the other?
Well, you can do it but I doubt you'll like the result... yy=18./y.^2; scatter(x,y) yyaxis right hAx(2)=gca; hA...

9 years ago | 0

Answered
how can I place my error bar in separate bar center?
See the "trick" to locate the midpoint of stacked bars from the hidden property at <https://www.mathworks.com/matlabcentral/answ...

9 years ago | 0

| accepted

Answered
How to add/subtract elements of 2 matrices to create a new matrix of the same size based upon conditional statements?
Nothing needed but to use the result of the logical array as an addressing expression... Mrx=Mx; % build the start point;...

9 years ago | 0

| accepted

Answered
Calling Excel and Matching Data in Matlab
Consider using |readtable| to bring the data in; making the ID column |categorical| data type will have advantages in writing lo...

9 years ago | 0

Answered
Index exceeds matrix problem
In brute force, use |try ... catch ... end| to catch the error elements for i=1:length(cell) try if cell{i}(3)=...

9 years ago | 0

Answered
My function output has complex numbers, and I'm not using i or j. Why?
angle = acos(dot(a,b)/(norm(a)*norm(b))); >> acos(2) ans = 0.0000 + 1.3170i >> acos(1+eps) ans = ...

9 years ago | 0

| accepted

Answered
Excel and ActX Syntax Translate to Matlab
In case anybody else were to find this and want to see how it can be done...whether this is anything at all close to optimal I'v...

9 years ago | 0

Question


Excel and ActX Syntax Translate to Matlab
Trying to iterate over a collection object and can't figure out syntax...example is Worksheet=Excel.ActiveSheet; % return...

9 years ago | 1 answer | 0

1

answer

Answered
Polynomial fit from the equation
_Maybe you see the problem?_ Ayup...in plot(time, log10(y4), 'g-') you transformed the output of the transformed mode...

9 years ago | 0

| accepted

Answered
Finding out values for elements of an array from corresponding array elements?
I think simplest solution would be to just augment the weights array by a placeholder for the missing diagonal positions; then t...

9 years ago | 0

Answered
What is missing from MATLAB?
Perhaps more enhancement than missing, but... A search function that is tolerant of variable data types in the target object....

9 years ago | 0

Answered
How can I write a cell array containing strings to excel?
From the documentation, ... A — Input matrix matrix Input matrix, specified as a two-dimensional numeric or charac...

9 years ago | 0

| accepted

Answered
Read 2 specific columns in excel file
In the addressing expression (:,1,:,7) there are four dimensions, not just two -- the first colon will reference all rows, then ...

9 years ago | 1

| accepted

Answered
How to run a .bat file in background without opening command prompt?
Presuming Windows, try something like cmd='yourprogram inputs'; % the command line to execute to run your model...

9 years ago | 1

| accepted

Question


Rearrange cell content by groups
There's got to be a simple way to do this... Have a cell array of data by date wherein there are N (or fewer) instances of M ...

9 years ago | 2 answers | 1

2

answers

Answered
Problem with processing files in a for loop
Don't say what doesn't work or give error message, but the first dereferences a single element of the directory structure while ...

9 years ago | 0

| accepted

Question


Comment folding in ML Editor
Finally got a 64-bit machine/OS so updated to R2016b. Now the code editor wants to wrap comments past the RH margin...I thought...

9 years ago | 1 answer | 0

1

answer

Answered
How to ignore values in an array
Having read the question multiple times now, the crystal ball is suggesting you simply wanted to treat the first element uniquel...

9 years ago | 0

| accepted

Answered
How to set ytick in yyaxis?
Almost--the function name is plural, not singular.. ... yticks([7.7:0.2:8.7]);

9 years ago | 1

| accepted

Answered
Find repeated close values in array
Assume your data are sorted as shown; if not sort first. thsh=3000; % threshold for grou...

9 years ago | 1

| accepted

Answered
How can we call a variable defined in a function file to another script file?
Well, you had the right idea; you didn't show us the syntax used but you must refer to the variable that is returned from the fu...

9 years ago | 0

Answered
Hello! I need to extract the lines which start with PG10 from this text file. Could you please help me. Thanks! I would use while loop but I am not sure how.
fmt=['PG10 ' repmat('%f ',1,8)]; fid=fopen('sp3data.txt'); PG10=[]; while ~feof(fid) PG10=[PG10; cell2mat(textsc...

9 years ago | 0

| accepted

Answered
How can i find largest 8 bit number from these 08 bit numbers i m getting ?
That's a new one to me...but, it's not of a lot of use for the purpose you're asking about as it is still a vector representatio...

9 years ago | 0

| accepted

Load more