Answered
Script Skips a portion of code
If length(Daily) is less than 4, the result of the expression 4:length(Daily) will be empty and so the body of that loop will no...

7 years ago | 0

| accepted

Answered
How do I combine data from seperate tables into one table with seperate columns
Consider converting these table arrays into timetable arrays. If you do you can synchronize them all to a common time basis. See...

7 years ago | 0

Answered
str2num results
From the documentation page for str2num: "In addition, str2num uses the eval function, which can cause unintended side effects w...

7 years ago | 0

Answered
Array Indexing in a for loop
Part 1: when one of the quantities you're multiplying is a scalar, the * and .* operators are equivalent. x = magic(4) y1 = 2*...

7 years ago | 1

| accepted

Answered
deep learning tool box
Prior to being renamed in release R2018b Deep Learning Toolbox was known as Neural Network Toolbox. To forestall one question I...

7 years ago | 0

| accepted

Answered
Change for loop stepsize
Rather than computing the elements yourself by repeated multiplication consider looping over a vector created using the logspace...

7 years ago | 0

Answered
Data loading in MATLAB
Loading the data could be as simple as calling load. The more challenging part is likely to be sharing this data among the vario...

7 years ago | 0

Answered
Slicing variable in parfor loop (restricted indexing)
What requirements must a variable satisfy to be a sliced variable? The documentation states four conditions: Type of First-Leve...

7 years ago | 2

Answered
Detecting values in a vector that are different but very close to each other
Use uniquetol to unique-ify the data with a tolerance. uniquetol can return a vector of indices that indicate to which of the un...

7 years ago | 0

| accepted

Answered
Can I check if factored and expanded polynomial forms are equal?
>> syms w k >> x1 = (w^2-k^2); >> x2 = (w+k)*(w-k); >> isAlways(x1 == x2) ans = logical 1

7 years ago | 0

Answered
Only one function doesn't work only after the app designer program is compiled
syms phi z0 This requires Symbolic Math Toolbox which is an ineligible product for MATLAB Compiler. Depending on what "some ...

7 years ago | 0

Answered
Put nested structure into another structure
Why not go directly to a table array? a = maketable("result1", 23, "mph"); b = maketable(["result1"; "result2"], [23; 34], ["m...

7 years ago | 0

| accepted

Answered
I have a complex number z = 5+3j, how do I find the phase of z, complex conjugate of z, and modulus of z?
See the documentation page on Complex Numbers for functions that may be of use when working with complex numbers in MATLAB. Reg...

7 years ago | 0

| accepted

Answered
Produce a diagnistic once per failed test method?
If you want to store your data, why not use a FileArtifact diagnostic? You could put it in a temporary folder created by a Tempo...

7 years ago | 0

Answered
How to call a function if unit test fails?
If all you want your function to do is display a diagnostic message, just modify your call to assert slightly. %% Unit test a ...

7 years ago | 1

Answered
Generating a weighted random number
Set up a vector of probabilities. dist = [2 1 1 1 1 1]; p = normalize(dist, 'norm', 1); % sum(abs(p)) is effectively 1 Use th...

7 years ago | 2

Answered
How to detect the 'end' directive in subsref?
Overload the end method for your class as described on this documentation page. The reason end was always taking the value 1 is...

7 years ago | 2

| accepted

Answered
Matlab and IDL Data Types
The default data type in MATLAB is double. There are some functions and functionality that by default create variables of diffe...

7 years ago | 0

Answered
Random but equal distribution of numbers 1 and 2
Do you need exactly equal numbers of 1's and 2's or just a vector where each element has an equal probability of being 1 or 2? ...

7 years ago | 2

| accepted

Answered
What type of function Matlab has help to construct symmetric matrix?
Several of the matrices you can create using the gallery function are symmetric, and some have other interesting and/or useful p...

7 years ago | 1

| accepted

Answered
Removing columns from a 5x5 matriz
Indexing. The end keyword will also be of interest to you.

7 years ago | 0

| accepted

Answered
Why not adding space between words
If you're using a release that supports string arrays, you can simplify this a bit if you trust MATLAB to do "something reasonab...

7 years ago | 1

Answered
Why does the function call "function [hdr, record] = edfread( 'chb01_01.edf',var​argin )" give an error?
If you're trying to call the function using that syntax, don't specify the function keyword (which is used for defining function...

7 years ago | 0

Answered
How can i distribute plot markers normally?
If you're using release R2016b or later and want to specify which of the data values you're passing into plot have markers assoc...

7 years ago | 0

Answered
computing matrix without using for loop
Compute the matrix k*l using implicit expansion with element-wise multiplication. The other operations (cos, sin, scalar multipl...

7 years ago | 0

| accepted

Answered
How do I add a column vector or matrix to a 6X6 original matrix?
C_m = [c11 c12 c12 0 0 0 c12 c11 c12 0 0 0 c12 c12 c11 0 0 0 ...

7 years ago | 0

Answered
error graph with EdgeTable
You are correct that the edges stored in the Edges table of the structure variable have been reordered, and so the values in typ...

7 years ago | 0

| accepted

Answered
Problems with averages and storing values
Preallocate your Y vector. Keep track of the next element of Y to be filled and fill in that element each iteration through the ...

7 years ago | 0

| accepted

Answered
what does . and .. refer to
For the operating systems on which MATLAB is supported, . refers to the current directory and .. the parent directory, as stated...

7 years ago | 0

Answered
Drawing Polygon shapes with data
You could build a polyshape array with one element for each region that you want to draw. Once you've built your polyshape array...

7 years ago | 0

Load more