Answered
Replacing values in a matrix based on values in another matrix
Use logical indexing (see Ch 11 of MATLAB Onramp) A = [0 1 1 0] B = rand(size(A)) B(A==1) = 99

4 years ago | 0

| accepted

Answered
How can I plot histogram matlab to uiaxes APP designer?
imhist is not supported in App Designer yet (as best I can tell). However, you may be interested in this example, which uses his...

4 years ago | 1

| accepted

Answered
whats wrong with this code?
I think this error may just mean you may just need to clear your workspace before running your code. At least I was able to repr...

4 years ago | 0

Answered
Why is ReadTable Deleting Data with NaN?
The columns of a table must all be of the same datatype. readtable has set the datatype for each column based on the datatype in...

4 years ago | 1

Answered
how to assign strings to a character array?
I think you are using the terms string and char array interchangably, but they are two separate data types in MATLAB. Strings an...

4 years ago | 0

Answered
convert array that has NAN to 0
You can't have two assignment operators (the equals sign) in a single command. I think you just want this Charge_P(isnan(Charge...

4 years ago | 0

| accepted

Answered
How to find out number of Fridays in a month?
Not sure what your current code is, but what about something like this using weekday? year = 2022; month = 4; dt = datetime...

4 years ago | 0

Answered
How to make a discrete colorbar with specified intervals?
In re-reading the orginal question, it is worth clarifying that this solution only visually creates the colorbar. On its own tha...

4 years ago | 5

| accepted

Answered
How can I add multiple excel files into a structure?
Though I would also recommend a solution that uses readtable over xlsread, if you have code that works already, why not turn it ...

4 years ago | 1

| accepted

Answered
I want to create a bar3 plot for the contribution of two parameters as like in figure
I see what you are saying. Magnitude corresponds to your Y axis, which corresponds to the rows of B. In the file, they increase ...

4 years ago | 1

Answered
Unrecognized function or variable 'importTensorFlowNetwork'
importTensorFlowNetwork requires the Deep Learning Toolbox Importer for Keras Models support package. To install this support pa...

4 years ago | 1

Answered
TASK Add a Pipe (IL) (Isothermal Liquids > Elements) and a second Reservoir (IL) block. I Am Unable to Complete it, keep showing Error while submitting
I discovered this is a known issue. In the meantime, see this Answer for a workaround https://www.mathworks.com/matlabcentral/a...

4 years ago | 3

| accepted

Answered
how can we get this about in simulink model
Use a Ramp block. Adjust the block parameters to get your desired output and slope values. Connect to a Scope block and simulate...

4 years ago | 0

| accepted

Answered
How to build a 3D chart from a 2D table
What type of 3d chart do you want to create? For a surface, you could use the following syntax (Z needs to be a matrix). Just n...

4 years ago | 0

Answered
SIMULINK ONRAMP 4.2 Basic Logic Further Practise
Further Practice exercises are not assessed. The signal you see in the assessment pane is for Task 3. The Further Practice says ...

4 years ago | 0

Answered
Not able to access all the self-paced courses
The only self-paced courses that are available to everyone are the onramps. All other courses require a separate license for Onl...

4 years ago | 0

| accepted

Answered
How to plot contour plot of a function?
I would use meshgrid to create the arrays x and y, and then use those to calculate I without symbolic variables. However, in do...

4 years ago | 0

Answered
[macOS] MATLAB Drive Connector requires login on every restart
Please contact support

4 years ago | 0

Answered
Find complete rows that meet a condition
You could use two conditions - one for the first column and another for the 2nd column - to find the rows that meet your criteri...

4 years ago | 0

| accepted

Answered
Plotting a multi-dimensional matrix
If you want to create a 2D line plot where there is a different line (data series) for each sheet of your array, the simplest wa...

4 years ago | 0

Answered
How to add max and min data label of plot in matlab with help of annotation?
You limit you view of the data in the figure by using xlim, but not your search for max and min values. This does mean some of t...

4 years ago | 0

Answered
How to set number of value ranges in colorbar?
Use the 'tick' property to specify tick locations. See this related answer: https://www.mathworks.com/matlabcentral/answers/4477...

4 years ago | 1

Answered
find(V,1) returns an index that doesn't match with the plot
Find tells you the index value of the elements of SL_B_Optml that meet your criteria. It therefore will be an integer value. How...

4 years ago | 0

| accepted

Answered
There are no products to uninstall
This new error suggests that you have not installed the MATLAB Engine for Python. Follow the instructions here: https://www.mat...

4 years ago | 0

Answered
Calcuating equally-spaced sums from unevenly-spaced time-series data
I would put your datetime and bytes into a table (consider cell2table). Convert your times to datetime, and then use sortrows to...

4 years ago | 1

| accepted

Answered
Datetime errors when I import data
You are passing a character array into the datetime function, not a variable Maturity = datetime('Scadenza'); This line of cod...

4 years ago | 0

| accepted

Answered
Workspace selection dropdown when debugging missing in R2022a
I believe it is still there but in a differnt location. See this page: https://www.mathworks.com/help/matlab/matlab_prog/examin...

4 years ago | 1

Answered
There are no products to uninstall
See this answer: https://www.mathworks.com/matlabcentral/answers/92244-how-do-i-uninstall-matlab-on-windows-when-the-uninstaller...

4 years ago | 0

Answered
Finding outliers in a dataset
If you process your data in a live script, consider interactively exploring different ways to detect and remove outliers using t...

4 years ago | 0

Answered
combine two cell into one string
I would do this in 2 steps. file = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1085370/SummaryResult%20-%20...

4 years ago | 0

Load more