Answered
How to store consequtive numbers and vector jumps in different matrices?
A=[1,2,3,6,7,8,11,12,13,14,15,17,18,19,30,31,32]; a=diff(A); n=num2str(a==1);nn=num2str(a~=1); n=n(n~=' ');nn=nn(nn~=' '); [...

4 years ago | 1

Answered
Indexing matrix from array
A = [1:3; 4:6; 7:9]; B = logical([1;0;1]); C=A(B,:);

4 years ago | 0

| accepted

Answered
How to load a matrix from a complicated txt file?
r=readmatrix('Slice5mm.TXT'); r(:,1)=[];r(1,:)=[];

4 years ago | 0

Answered
Matrix with random integer and defined rank
r=1; while r~=2%desired rank M=randi(100,3); r=rank(M); end

4 years ago | 0

Answered
Question on summing function handles
No need for for-loop t = linspace(0,2*pi,9); x = linspace(-0.5,0.5,5); [T,X]=meshgrid(t,x); fj = sin(T)-sign(X); S = @(t,x)...

4 years ago | 0

Answered
How to extract the 4 MSBs of decimal numbers in a matrix?
a=randi(255,10); d=dec2bin(a(:),8); msb4=d(:,1:4)-'0';

4 years ago | 1

| accepted

Answered
Irregular intervals inside a for loop
for p=1:100 for a=1:n %Action A end for b=1:m %Action B end end

4 years ago | 1

Answered
Fibonacci function [f,n] in matlab
Try a structure like this: function [f,n]=find_fibonacci(x) F=[1 1]; n=2; while F(n)<x %write code here end f=%write ...

4 years ago | 0

Answered
When I run this code an error occurs that says array indices must be positive or logical values.
Not sure what you are trying to do, but rotCoords is 260x260 and sinogram is a 260x91. You cannot index inside sinogram with rot...

4 years ago | 0

Answered
Plotting of roots of polynomial with respect to a variable
d=[1 -1 2 -2 3 -3];%whatever values you want for d figure; hold on; for k=d p=[3 -2 5 k]; r=roots(p); q=r(real...

4 years ago | 0

| accepted

Answered
Help using fsolve (theta beta mach)
syms theta; beta=35;M=1.3;%example eqn=tand(theta) == 2*atand(beta)*(M^2*sind(beta)^2-1)/(M^2*(1.4+cosd(2*beta))+2); vpasolve...

4 years ago | 1

Solved


Find the nth nude number
The number 672 is a nude number because it openly displays three of its divisors: 6, 7, and 2. In other words, a nude number is ...

4 years ago

Solved


Count alternating permutations
In an alternating permutation of numbers 1 to n, the numbers are arranged so that they alternately increase and decrease. For ex...

4 years ago

Answered
Iterating/repeating input values to plot against outputs without turning the input into a matrix?
You can use ndgrid to vary all the perameters you want, although the matrix sizes can become quite large and run-time will incre...

4 years ago | 1

Answered
How can I group positive peaks in groups by their similar values ?
[~,~,bins]=histcounts(pks_max,[0 10 20 30 40 50 60 70 80 90]);%or whatever bin edges you want u=unique(bins); for k=1:numel(u)...

4 years ago | 0

Solved


Find offset of an element of a multi dimensional matrix
For a given multi dimensional matrix and given element, find its offset from the 1st element. Return 0, if element is not fo...

4 years ago

Answered
set of equations to represent Truncated icosahedron
Look at my file exchange below (p566). https://www.mathworks.com/matlabcentral/fileexchange/73740-archimedean-solids

4 years ago | 0

Answered
how to generate random numbers in a cell of 10m by 10m with 20 nodes and assign numbers to each node
SU=10*rand(20,2);%sample points example PU=10*rand(10,2);%sample points example scatter(SU(:,1),SU(:,2),'k*') hold on; text(...

4 years ago | 1

| accepted

Answered
Changing image into bytes, then bitstream, then bytes and back into photo?
A = imread('peppers.png');%read in image s=size(A);%need 3D matrix size to reshape at end B = dec2bin(A(:),8)';%A(:) reshapes ...

4 years ago | 1

| accepted

Solved


World Cup 2018 Prediction!
Which team will be the winner?

4 years ago

Solved


Percentage profit:4
If a shopkeeper is selling W gram of salt in 1 dollar he will face r% loss. How much salt he should sell in grams to make r% pro...

4 years ago

Solved


Percentage profit:3
x% product is sold at r1% profit. However, our target overall profit is rt%. What is the required percentage profit to meet the ...

4 years ago

Solved


Percentage profit
If you are buying at x dollar, what will be the selling price for making the r% profit?

4 years ago

Solved


Datetime basics
Generate the datetime scalar representing the current date

4 years ago

Solved


Check for keywords
If the entered string is a MATLAB keyword, return true else false

4 years ago

Solved


Substring Extraction
In a given string, find the substring between Start_string and End_string. You will have to include or exclude the Start_str...

4 years ago

Solved


Basic matrix operations using standard MATLAB commands
Create the matrix: 1.0e+15 * 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000...

4 years ago

Solved


Let's make puddings !
We will make puddings with eggs, milk and sugar. To make one pudding, we need one egg, 140(cc) of milk, 15 (g) of sugar. Now W...

4 years ago

Solved


I hope to lose weight healthily...
In order to reduce weight healthily, weight will be reduced by 4% every month. Please calculate how many months it will take...

4 years ago

Solved


Please check the last row
We have data of matrix, that is input. That contains 2 or more rows and the last row should contain the average of each column,...

4 years ago

Load more