Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
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)))/...

presque 4 ans il y a | 0

| A accepté

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

presque 4 ans il y a | 1

Réponse apportée
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,[...

presque 4 ans il y a | 0

Réponse apportée
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)

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 1

Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
Read Data from Text File as Matrix
a=readmatrix('1.txt'); X=a'

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to save output (Matrix) in excel files?
M: your Matrix X=your excel file name writematrix(M,'X.xls')

presque 4 ans il y a | 0

Réponse apportée
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,'...

presque 4 ans il y a | 1

A résolu


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 ...

presque 4 ans il y a

A résolu


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...

presque 4 ans il y a

A résolu


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

presque 4 ans il y a

A résolu


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 ...

presque 4 ans il y a

Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
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')

presque 4 ans il y a | 0

A résolu


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

presque 4 ans il y a

A résolu


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

presque 4 ans il y a

A résolu


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...

presque 4 ans il y a

A résolu


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

presque 4 ans il y a

Réponse apportée
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)

presque 4 ans il y a | 1

Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
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...

presque 4 ans il y a | 0

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

presque 4 ans il y a | 1

| A accepté

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

presque 4 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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

presque 4 ans il y a | 1

Réponse apportée
datetime format issue?
datelimits = datetime({'20080401', '20080402'}, 'Format', 'yyyyMMdd')

presque 4 ans il y a | 0

Réponse apportée
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...

presque 4 ans il y a | 1

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

presque 4 ans il y a | 1

Charger plus