Answered
Take percentage of a data set
A = rand(9000,10) ; [m,n] = size(A) ; p = 0.4 ; % 0.4 percentage id = round(m*p) ; iwant = A(1:id,:) ;

6 years ago | 0

| accepted

Answered
for loop through a cell array
If A is your cell array, you can access the cell suing A{1}, A{2}, ... A{i},..etc. for i = 1:length(A) A{i} end Also ha...

6 years ago | 0

Answered
Code for Monotonically increasing function
x= [ -3 -2 -1 0 1 2 3] ; function tf = mono_increase(x) tf = 1 ; for i = 1:length(x)-1 if x(i+1) < x(i) tf = 0 ; ...

6 years ago | 0

Answered
HOW TO RUN AN UNLIMITED FUNCTION ON MATLAB
Read about loops. You have to use a for loop to achieve waht you want. You can make your code into a function and call it insi...

6 years ago | 0

| accepted

Answered
How can i remove "==" from symbolic equation?
syms x1_dot u x2_dot x1 x2 x3 x1_dot = (1570*u)/41 - x3*x2_dot - (3060*x1)/(41*x3) - (6426*x2)/(1025*x3)

6 years ago | 0

| accepted

Answered
how to do looping with over many variables ? (MONTE CARLO)
for n = 3:100 n end

6 years ago | 0

| accepted

Answered
How to Make this Plot?
You can plot the region/ polygon use plot. You should be having these coordinates of lat, lon in shape file. You can show up t...

6 years ago | 1

| accepted

Answered
How to code a function that calculates the redundancy of a given alphabet
It looks like you are using Octave. You can call functions in multiple ways. Option 1: function h = alph_entropy(P) h = ...

6 years ago | 0

| accepted

Answered
Drawing a cube using line command
You can use plot, patch, fill after arranging the vertices in a order. Refer this: https://de.mathworks.com/matlabcentral/file...

6 years ago | 0

Answered
shows the error matrix dimensions must agree
clc; close all; A=imread('index.jpg'); im=rgb2gray(A); im=imnoise(im,'gaussian',0,0.5); [m,n,d]=size(im); xc=round(m/2); ...

6 years ago | 0

Answered
how to find the error between this two equation?
https://de.mathworks.com/matlabcentral/answers/4064-rmse-root-mean-square-error

6 years ago | 0

Answered
rearrangement rows of matrices
A = repmat((1:15)',1,5); B = [A(1:5,:), A(6:10,:), A(11:15,:)]; [r,c] = size(A) ; n = 3 ; C = permute(reshape(A',[c,r/n,...

6 years ago | 0

Answered
Plotting a line of desired length starting from a particular point with slope given.
P0 = rand(1,2) ; % initial point m = 1. ; % slope % Equation of line y-y1 = m*(x-x1) x1 = 1. ; % some value y1 = P...

6 years ago | 0

Answered
I don't know how to prove sin^2(x)+cos^2(x)=1
There are multiple ways to prove this: Option 1: x = rand ; sin(x)^2+cos(x)^2 Option 2: syms a b c sinx = a/c ; cosx...

6 years ago | 0

| accepted

Answered
How do I find the values of 2 variables that will make my matrix rank 6?
for x = -10:1:10 for y = -10:1:10 A = [ 4, -3, 0, 0, 0, 0, 0 -2, 0, 1, 0, 0, 0, 0 -6, 0...

6 years ago | 1

| accepted

Answered
Creating Diagonal Matrix from a Vector
g = rand(1,4) ; m = length(g) ; P =zeros(m) ; d=size(diag(P,i),1);%this is the size of the vector with elements of the k...

6 years ago | 0

Answered
How to take logical or of all the elements in the vector without a loop?
Note that you have two types of indexings in MATLAB. Indexing This is a number and should be posittive integers greater than...

6 years ago | 0

Answered
How do you use the "interp1" command?
Try: y_int_top = interp1 (x_c.(1), y_top.(1), x(1, 1:65) ) ; y_int_bot = interp1 (x_c.(1), y_bot.(1), x(1, 66:130)) ;

6 years ago | 0

Answered
How to animate two functions at the same time?
m = 100 ; x1=linspace(0,exp(1)-0.01,m); x2=linspace(exp(1)+0.01,10,m); y1=(log(x...

6 years ago | 0

| accepted

Answered
Logical array inside an expression
A = { 'aim' , '4' ; 'result' , 'peak' }; % this is cell array of strings C = strcmp (A, 'result' ); % comapre the string '...

6 years ago | 0

| accepted

Answered
ho to update vertices on sphere?
This is tough ..you need to code it. But you can do it using some ocmmands. Read about ginput or getpts. Pick two points: 1. Fir...

6 years ago | 0

Answered
Why does the imshow function display a white image despite the image matrix consisting of elements ranging from 0-255?
Convert the image into uint8 or uint16 and then use imshow.

6 years ago | 0

Answered
plot 2 matrix together
Is this what you are looking for? y=[7.1165 9.6022 8.9144 9.2717 6.3400 4.0484 0.3411 -0.6784 -5.7726 -5.4925 -9.4523 -9.7232 ...

6 years ago | 1

Answered
curvature of mode shape
Already you have written what you want and it should be bit placed properly. Let y be your array. n = length(y) ; r = zeros...

6 years ago | 0

| accepted

Answered
Delete the duplicate rows
Read about unique.

6 years ago | 0

Answered
How can I plot acquired matrix data
Refer this link: https://in.mathworks.com/matlabcentral/answers/412639-creating-surface-plot-from-a-matrix-with-3-columns

6 years ago | 0

Answered
How to find the max value of a curve on a graph
If (x,y) are the data points. [val,idx] = max(y) ; plot(x,y) hold on plot(x(idx),y(idx),'*r')

6 years ago | 0

Answered
How do I rotate a 3d plot surf by MATLAB code?
Read about view. Also there is a rotate symbol on the figure generated. You can use that to rotate.

6 years ago | 0

Answered
Indexing force plate data
If (x,y) is your data. You can get those y values of 0.01 using: tol = 10^-4 ; % consider changing this idx = abs(y-0.01)<=...

6 years ago | 0

| accepted

Answered
how to change color for one point in the scatter plot
a=[1:10]'; b=[11:20]'; scatter(a,b,'o','filled'); hold on scatter(a(4),b(4),'or','filled') Also you can use plot a=[1:10]';...

6 years ago | 0

Load more