Answered
Arrays have incompatible sizes for this operation problem in if statement
Don't use == for comparing char vectors. If the char vectors you're comparing don't have the same number of characters that won'...

3 years ago | 0

| accepted

Answered
Speed up 3D rand
tic A = rand(1000, 1000, 1000); t = toc So on average rand generated 1 number every: format longg s = seconds(t/numel(A)) ...

3 years ago | 0

Answered
Data Analysis - Matlab Code
I would use the normalize function or the Normalize Data task in Live Editor.

3 years ago | 0

Answered
How to convert 50x1 double to 1x100 double?
How do you want the additional 50 elements to be created? Or to give a smaller example, take y. y = (1:5).^2 If we wanted to ...

3 years ago | 0

Answered
How can I create a solid line from the data within a for loop?
Either use an animatedline object or create the line before the loop starts and add points to its XData and YData properties ins...

3 years ago | 0

Answered
Why am I getting inf even though there is no divide by zero?
To determine why an Inf is generated even though you don't believe there should be any division by zero performed by your code, ...

3 years ago | 0

Answered
Why does my EdgeColor map incorrectly to the edges of my Graph Plot?
Let's compare the EdgeTable variable and the Edges property of the graph. %% Construct arbitrary dataset EdgeTable = table('Si...

3 years ago | 0

| accepted

Answered
Creating a matrix such as a = [1 1 1 1 1 1 1; ... 1 2 2 2 2 2 2; ... 1 2 3 3 3 3 3; ... 1 2 3 4 4 4 4; ... 1 2 3 4 5 5 5; ... 1 2 3 4 5 6 6; ...
A = gallery('minij', 7) See the documentation for the gallery function for a list of the other types of matrices it can create....

3 years ago | 0

Answered
Regexp to extract standalone numbers from string
I wouldn't use regexp here. I'd use string, strsplit, and double. S = 'X?YYx0123 [un] 21ZZz20AaaB00 A200.1 21 Xx2222 202...

3 years ago | 1

Answered
Sorting a string according to the values of a vector of type double
Take a look at the second output from the sort function.

3 years ago | 0

Answered
Problem while creating a stand alone application from appdesigner
If you're trying to open the Workspace Browser from within your deployed application I'm 99% sure that falls into the "other dev...

3 years ago | 0

Answered
create plot task not available in live script despite having other control toolbox options
Do you mean this task? That is part of MATLAB. There is a documentation page for this task in the Control System Toolbox documen...

3 years ago | 1

Answered
What qualification do I need to apply for an internship at MATLAB?
Different departments have different qualifications that they're looking for in intern candidates. Take a look at the list of in...

3 years ago | 0

Answered
Passing arguments through a function
You could do this using varargin, but if you do make sure you like the function's interface before you give it to anyone else. B...

3 years ago | 1

Answered
Fast creation of vector [0 0 1 1 2 2 3 3... n n]
n = 5; x1 = repelem(0:n, 2)

3 years ago | 1

Answered
what is the codes of this equations?
You probably want to define your kets as vectors. Since you're taking infinite sums you probably want to define them as symbolic...

3 years ago | 0

Answered
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parenthe
This is not valid MATLAB syntax. I've commented it out so that later lines of code in this answer can run. % fun = @(x) (0.00 0...

3 years ago | 0

Answered
How do you use the solve function in a mat lab GUI?
Are you attempting to define app.c and app.t as symbolic variables using these lines? system app.c system app.t That won't w...

3 years ago | 0

Answered
An alternative to cell array
You say that you need to call this function many times, but do you need the M output from each of those calls to exist in memory...

3 years ago | 0

Answered
Histogram set custom DisplayOrder
Specify the valueset in the order in which you want the categories to be listed when you construct the categorical array. BTW, ...

3 years ago | 0

| accepted

Answered
How to use matlab to achieve multiple cycles, as shown in Figure 1
Another approach would be to take advantage of the fact that a for loop in MATLAB can iterate over columns of an array. for ij ...

3 years ago | 0

Answered
How can I access char elements from the beginning up to some fixed index of the char?
The extractBefore function will work both for char arrays and strings.

3 years ago | 0

Answered
How to get a complete list of class properties including private properties.
Create a metaclass object and iterate through the PropertyList.

3 years ago | 0

| accepted

Answered
finding singular outliers in the presence of data with steep changes but not singular
I think the outlier detection and removal functions in MATLAB are the right tools for you to use. Choosing the right parameters ...

3 years ago | 0

| accepted

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
MATLAB has a suite of debugging tools you can use to investigate errors like this. One of the ones I use most frequently is the ...

3 years ago | 0

Answered
Can the efficienty of this code be improved, either computationally or just in terms of lines of code?
A = [2; 4; 1; 2; 2; 4; 1; 2; 2; 4]; B = [4.10047; 7.44549; 3.62159; 6.56964; 2.87221; 4.51231; 4.01697; 5.60534; 5.5440; 7.0780...

3 years ago | 0

Answered
Helix/dipoleHelix in MATLAB R2016b version
This function is part of Antenna Toolbox. Check the output of the ver function to see if you have this toolbox installed. If you...

3 years ago | 0

| accepted

Answered
Add-ons not available for MATLAB Home
On the MATLAB Home page click the "Customize and buy" button. This will bring you to the store that gives you a list of add-on p...

3 years ago | 0

| accepted

Answered
Variable marker size scatter plot
The size input argument to the scatter function can be a scalar or an array of the same size as the coordinate data. In the exam...

3 years ago | 0

| accepted

Answered
Adding prefix to indexe
This section of code, as originally written, assumes you're on Linux or Mac. We can make this a bit more platform independent. ...

3 years ago | 0

Load more