Answered
Write a function that takes a number to be guessed and a player number, and checks if the winning criteria is met.
trying to find out the nearest minimum and maximum value userguess=[2 5 10 17 19]; gamenum=13; y=NumberGuess(gamenum,usergues...

4 years ago | 0

Answered
MATLAB CODE FOR PLOTTING WON'T DISPLAY A LINE
try this: x=[0:0.002:2]; R=0.12; betta=2.623; H=0.2; K=0.5; y=(R.*(H.*x.^2.*betta.^2-betta.*x+x.*betta.*(2-H.*betta.*x)))/...

4 years ago | 0

| accepted

Answered
Plot a histogram from given data.
try this: B = readtable('hw3.txt','ReadVariableName',false,'delimiter',':'); data2=B(:,2); data3=table2array(B(:,2)); data4=...

4 years ago | 1

Answered
I want to know how to multiply array elements one by one.
A=[1 2; 3 4]; B1=A(1,1)*A(:); B2=A(1,2)*A(:); B3=A(2,1)*A(:); B4=A(2,2)*A(:); matrix=[B1 B2 B3 B4]; out=reshape(matrix,1,[...

4 years ago | 0

Answered
How can we randomly assign the number we want to the machines that write 1 in the 1-0 matrix?
after for loop, try this y=population; y(y==1)=randi([2 10],1,1)

4 years ago | 0

| accepted

Answered
The code works but the 1st column shows NaN and 3 numeric data is missing.
try this: data = readtable('hw3.txt','ReadVariableName',false,'delimiter',':'); data2=table2array(ata(:,2)) data3=split(data3...

4 years ago | 1

Answered
how to floor time for each hour?
A={'12-Dec-2021 09:09:04' '12-Dec-2021 09:24:04' '12-Dec-2021 09:39:04' '12-Dec-2021 09:54:04'}; B=datetime(A,'F...

4 years ago | 0

Answered
Read Data from Text File as Matrix
a=readmatrix('1.txt'); X=a'

4 years ago | 0

| accepted

Answered
How to save output (Matrix) in excel files?
M: your Matrix X=your excel file name writematrix(M,'X.xls')

4 years ago | 0

Answered
How to import variable names and specific data range (comma separated values) from a .txt file?
try this: A=readtable('Earth-Moon_sys_ephem_at_ast_epochs.txt','delimiter','tab'); B=table2cell(A(20,:)); parameter=split(B,'...

4 years ago | 1

Solved


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

4 years ago

Solved


Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

4 years ago

Solved


reverse string
input='rama' output='amar'

4 years ago

Solved


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

4 years ago

Answered
Please anyone can help to plot a graph, i didnt get a graph for the below program, it didnt showing any error, the output coming like a blank graph.
try this: cj1 = 4.5e-12; vs1 = -10; cj2 = 6.5e-12; vs2 = -2; vc = 0.65; num = cj1/cj2; den = (vc-vs2)/(vc-vs1); m = 0.0264...

4 years ago | 0

Answered
Create txt file from each row of Matrix
A=randi(100,3,7500); writematrix(A(1,:),'myfile1.txt') writematrix(A(2,:),'myfile2.txt') writematrix(A(3,:),'myfile3.txt')

4 years ago | 0

Solved


Negative matrix
Change the sign of all elements in given matrix.

4 years ago

Solved


Min of a Matrix
Return the minimum value in the given matrix.

4 years ago

Solved


Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

4 years ago

Solved


Sum of first n positive integers
Given n, find the sum of first n positive integers Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these terms is 55

4 years ago

Answered
ismembertol: What am I doing wrong?
try this: x=readmatrix('x.txt'); Transparency = x(x>=0.9 | x<=0.8); [Lia,~] = ismembertol (x, Transparency,1e-16)

4 years ago | 1

Answered
Get and interpolate missed daily data
A=(datetime(2030,1,1):datetime(2060,12,31))'; % generating normal date A1=datenum(A); C=readtable('missed data.xlsx'); D1=da...

4 years ago | 0

Answered
How do i write this code for different timestep like this code is for 3600 and i want to use different timesteps like 1800,900,450
I have considered Yb=5 and Yp=8. nsteps = 12; t = zeros (nsteps,1); A = zeros (nsteps,1); B = zeros(nsteps, 1); P = zeros(n...

4 years ago | 0

Answered
HOW CAN CREATE A MATRIX FROM A SINGLE ROW?
use reshape function. A=randi(100,1,12) output=reshape(A,3,4)

4 years ago | 1

| accepted

Answered
converting the time data into Datetime Format
try this syntax: th = datetime(A.TimeStamp,'InputFormat','dd.MM.yyyy HH:mm:ss.SSS','ConvertFrom','datenum');

4 years ago | 1

| accepted

Answered
Simplifying a code to one matrix
you can concatenate the matrix Mx and My either horizontally or vertically % if horizontal output=horzcat(Mx,My) % if vertica...

4 years ago | 0

| accepted

Answered
i need to count the number of switches between numbers ( the frequency)
one approach. might be some other nice way A=[1,0,1,0,1,0,1,0]; B=numel(diff(A))+1

4 years ago | 1

Answered
datetime format issue?
datelimits = datetime({'20080401', '20080402'}, 'Format', 'yyyyMMdd')

4 years ago | 0

Answered
Extract same row and columns of matrix
you can find your answer here https://www.mathworks.com/matlabcentral/answers/266736-how-can-i-find-same-values-in-an-array Re...

4 years ago | 1

Answered
How to convert a string into row vector?
try this: a = 753; b= dec2bin(a) % b= '1011110001' format longG output=str2double(b)

4 years ago | 1

Load more