Answered
plotting side-by-side error bars and data points
To get error bars on either side of data points, modify their x-coordinates using a threshold. However, the plot obtained is no...

3 years ago | 0

| accepted

Answered
How do I change the output of the graph from velocity to acceleration?
m = 46; % mass k = 3220; % spring constant c = sqrt(184*k); % damping constant f = 46*(9.8); %force Time = 0:0.1:1; %1X2 mat...

3 years ago | 0

| accepted

Solved


Inscribe a circle in a triangle with a side of length equal to the circle’s circumference
A circle of radius is inscribed in a triangle with a side that has a length equal to the circle’s circumference. The center of ...

3 years ago

Answered
Generate ones and zeros based on size of each element in a matrix nxn
The output corresponding to 0 in a (i.e. a(2,1)) is a single 1. If that is the desired output, you will have to replace all the ...

3 years ago | 0

| accepted

Solved


Convert vector of strings to lower triangular matrix
Given a non-empty vector vec of strings, please put its elements into the lower triangular half of a square matrix M column-wise...

3 years ago

Answered
Count repeated numbers from a data column and produce new columns
Code edited to include output3 added by OP. @Georgios Tsiledakis, Use repelem() rather than looping over the data (especially w...

3 years ago | 2

Answered
Have one array follow another array with a threshhold
Use the same approach for A1 as well. A1 = [1 4 5 8 2 2 4]; A2 = [2 5 8 15 18 24 23]; A2Thresh = A2 < 10 | A2 > 30; A2(A2Thr...

3 years ago | 0

| accepted

Answered
"for" cycle to plot the point in a matrix with a certain radius
You should use tolerance to compare floating point numbers. Set tolerance according to the level of precision you want. And use...

3 years ago | 1

| accepted

Answered
When integrating numerically with integral2, the integral function contains a sign variable, causing the integral to keep reporting an error.
You don't need to use symbolic variables for this code. Define A as a function handle and use r values as an input to define the...

3 years ago | 0

| accepted

Answered
Getting an error "Error using erfc... Input must be real and full"
The function erfc only supports real inputs (as evident by the error) and the input to erfc here is complex. You can either use...

3 years ago | 0

Answered
Newton-Raphson algorithm stuck running after 4 or 5 iterations
Converting to numeric data type is much faster than using symbolic values syms x real %I have defined f to be an explicit func...

3 years ago | 0

| accepted

Answered
plot legend that depicts different markes of nodes
The problem here is that legend will only provide labels for what graphics recognizes as individual objects. So in a line plot, ...

3 years ago | 0

| accepted

Answered
Find minimum among matrices with different sizes
Your statements contradict each other, but I guess this is what you want to obtain A=[2 8 4; 7 3 9]; B=[1 3 5]; C=min(A,B)

3 years ago | 0

| accepted

Answered
i want to solve a set of homogeneous linear equation
Note - Symbolic Toolbox required Note that you might not get a solution for x depending upon the values of A. One such exampl...

3 years ago | 0

| accepted

Answered
i don't know code
Define f and g as function handles, and use x and the output of g(x) as inputs respectively - %Using different variable name to...

3 years ago | 1

Answered
How to build a function fun that takes as input the matrix A and as output provides the matrix B which is produced out of A in the following ways.
A much simpler way - a=[1 2 3 4;5 6 7 8;9 10 11 12; 13 14 15 16] s=size(a)/2; b=circshift(a,s)

3 years ago | 3

Answered
Add data class as additional information on 2D plot
text might be helpful

3 years ago | 1

| accepted

Answered
The numbers do not appear in standard format despite the writing (format shortG)
Using format is only applicable to numeric outputs. Change the formatting operator in fprintf to obtain the proper value - for...

3 years ago | 0

Solved


Zero finder
Write a function named 'zero_finder' that takes a matrix as input and returns the row index of the last zero for each for each c...

3 years ago

Answered
How to save index of Values of an item in a matrix?
x=[0,0,0,1,0,0,0,0,1,0,1]; y=find(x>0)

3 years ago | 0

Answered
symbolic trigonometrical function tan instead of log and imaginary equation
syms a b x real sol1=solve(a*sin(x) == b*cos(x),x,'Real',true) The solution obtained above can be derived by changing sin and ...

3 years ago | 1

Answered
How to obtain vector of specific values in MATLAB
It's not a good idea to dynamically define variables. Read - Why Variables Should Not Be Named Dynamically You can make a 96x16...

3 years ago | 0

Answered
How to take an average from range of values?
It seems you have copied the data from Excel and there is a loss of data in doing that. A= [0.0000 0.4341 -0.0000 -0.5910 -0.03...

3 years ago | 0

| accepted

Answered
How to prepare normalized feature matrix in MATLAB ?
%Random data D = rand(500,4); %minimum of each row minval=min(D,[],2); %maximum of each row maxval=max(D,[],2); %Vecto...

3 years ago | 0

| accepted

Answered
How to create multiple structure variables and assign values to them at one line.
%Assign any type of data to a field [AC.a, AC.b, AC.c, AC.d] = deal(5, 15, {'cell'}, '0'); AC

3 years ago | 0

Answered
Grouping values in a matrix according to a value in a row & its index position
Vectorized approach mat=[51 71 0 48.87 63.38 -2.30769230769231 42.15 55.97 -2.30769230769231 40.22...

3 years ago | 1

| accepted

Answered
Find min value of each column of 2D lattice and plot
It is better to define variables not varying with the loop index, out of the loop. Moreso, as you are using figure(). It's not ...

3 years ago | 0

| accepted

Answered
How to get the rows and columns from a matrix which do not fall into particular criteria?
Use negation on the logical indexing - x = 0:0.01:10; y = [sin(x); cos(x)]; %Get columns of y in which %first row is less th...

3 years ago | 0

| accepted

Answered
Need help with matlab code for below mentioned integrals
Note that you need symbolic toolbox to run this code - syms a b x y tau %Defining functions r(a,b) = exp(-a-b); f(a,x) = exp...

3 years ago | 1

| accepted

Answered
Can't run my 'if, elseif, else' code
if-else is not a loop, they are conditional statements. If you want to print/display something, use sprintf or fprintf or disp....

3 years ago | 1

Load more