Answered
Iterating through Matlab Table
date = {'2014-05-20';'2014-05-21';'2014-05-22';'2014-05-24';'2014-05-25'}; % define the date name = {'Sanchez';'Johnson';'Li';...

4 years ago | 0

Answered
How can I find the line after the line containing the text I am looking for?
try this. not a function rather script A=readtable('Book5.xlsx', 'ReadVariableNames', false); B=table2cell(A); r = strtok(B, ...

4 years ago | 1

Answered
how do i get the set the current time as a datenum
t = datetime('now','TimeZone','local','Format','d-MMM-y HH:mm:ss Z') % current time datenum(t) % datenumber

4 years ago | 0

Answered
unable to plot this equation
i have considered the variable with random number t=1:20; I=0.5; a=randi(20,1,20); b=randi(30,1,20); c=randi(30,1,20); m=1...

4 years ago | 0

Answered
How to find elements of first matrix based on second matrix?
use find function A = [1 2 3 4 5 6 7 8 9 10]; B = [1 0 0 1 0 1 0 1 1 1]; result=A(find(B==1))

4 years ago | 1

Answered
I Want To Plot 30 Names On Y-Axis And Their Data on X-Axis
plot with discrete value. A=readtable('Example 30 Names and Data.xlsx','sheet',2,'ReadVariableNames',false); yvalue=table2cell...

4 years ago | 0

| accepted

Answered
how to plot data of the same date at one plot at a time
A=readtable('table.txt','ReadVariableNames',true); AA=table2array(A); year=A.YEAR; month=A.MONTH; day=A.DAY; dates = datenu...

4 years ago | 0

Answered
Data Output as matrix using For Loop
You don't need a loop for this. use reshape function % export data from text file A=readtable('Pbc1.txt','ReadVariableNames',t...

4 years ago | 0

| accepted

Answered
in the following MATLAB Programme, I want print the resultant Matrix D with two conditions i) D has exactly one Zero ii) D with exactly two pairs like as (-x, x) and (-y, y)
A = [0 1 0 0 1 ; 1 0 1 0 0 ; 0 1 0 1 0 ; 0 0 1 0 1 ; 1 0 0 1 0]; B = [-1 -2 1 2 0]; C = perms (B); D=C*A; [Lia, Locb] = ism...

4 years ago | 1

| accepted

Answered
Signal generation on Simulink?
You can use this script in a function block of Simulink. Just take y as a output in the simulink block. fs = 9000; % signal sam...

4 years ago | 0

Answered
I need to create a 3x3 matrix for each instance of x.
use reshape function to do this. A=randi(100,3,3000); % generating random matrix 3 by 3000 output=reshape(A,1000,3,3)

4 years ago | 0

Answered
Select values in one column based on entries in another column
load matlab [idx]=find(A(:,1)==-3.14) B=A(:,3); % third column Output=B(idx);

4 years ago | 0

| accepted

Answered
How to generate random number within specific values
Try this: prfSTG=randi([200 1200], 1,5); % generating random number between 200 and 1200 n_pulsesSTG = randi([200 1000], 1,5)...

4 years ago | 0

Answered
Graph Not Plotting for the For Loop Code
your output is a single value. if your code is going well then try this with a marker plot (h,rho, 'o')

4 years ago | 0

Answered
uthow can i code for. accelaration when velocity and time is given in the spread sheet.
A=readmatrix('udds.xlsx'); sqr=A(:,1).^2; acceleration=sqr./A(:,2); % acceleraiton= v^2/t ; accelration for each time whol...

4 years ago | 0

| accepted

Answered
What is the problem with that coding? Why it is showing that 'x' is unrecognized? I am new to learn matlab coding so frequently got stuck with coding.
you can read this first https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html I think here you...

4 years ago | 0

Answered
How to multiply matrix with matrix, only between their component counterparts
you need to multiplication element by element. you should use a dot (.) before any multiplication (*), division (/), or power (^...

4 years ago | 0

| accepted

Answered
Combine plot figures without losing legend
you can use subplot. i dont have your data. here is a demo example. figure(2) subplot(2,1,1); x = linspace(0,10); y1 = sin(x...

4 years ago | 0

| accepted

Answered
"Invalid use of operator."
if you want to perform element-by-element calculations with vectors, you should use a dot (.) before any multiplication (*), div...

4 years ago | 0

Answered
How to multiply each element with next one in the same row, then sum the product
according to your example, i think s would be only product of each element of a row. N=2; AA=randi(10,2^N,3); % random matri...

4 years ago | 0

Answered
NEED URGENT HELP !!!!!!!!!!!!!PLEASE IT'S FOR AN EXAM
have a look here https://www.mathworks.com/matlabcentral/answers/438692-how-to-prevent-xlsread-to-turn-string-data-to-nan-value...

4 years ago | 0

| accepted

Answered
I'm plotting solar pv Power/Voltage and I/V and the plot does not connect both axis. I can't find the problem
If you use 0.69 in the linspace you can get the figure. Io = 0.1*10^-9; IL = 9.5; V = linspace(0,0.69,100); q = 1.6*10^(-19)...

4 years ago | 0

Answered
Solve for, and then substitute.
you can use anonymous function: y=10; f=@(t) y*t; f(1) f(2)

4 years ago | 0

Solved


Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

4 years ago

Solved


Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

4 years ago

Solved


Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346

4 years ago

Solved


Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. http://en.wikipedia.org/wiki/Whole_numb...

4 years ago

Answered
for loop with the same variable but two values
if you want to use 'loop' b1=5; % assuming value yi=[2,3]; % assuming value aa=[4,4]; % assuming value bm=3; % assuming va...

4 years ago | 0

Solved


MATLAB Basic: rounding IV
Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

4 years ago

Solved


MATLAB Basic: rounding III
Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8

4 years ago

Load more