Answered
how to extract double value from a string?
"I tried this but it gives me NaN as result: " Does it? Let's check - str = "D:\MATLAB\noise_check\bilder\Image_230217_1227_T...

3 years ago | 0

| accepted

Answered
why does data mean(data, 1) give differnt answer form finding mean of individual columns ,like mean_clm = mean(data( : ,1)) ?
"why does data mean(data, 1) give differnt answer form finding mean of individual columns, like meancl = mean(data( : ,1)) ?" B...

3 years ago | 2

Answered
How can we display a value of function inside for loop seperatley instead of in a form of vector?
A = [1 2 3 4 5]; options=randperm(numel(A)); for i= 1:numel(options) select = options(i) end

3 years ago | 0

| accepted

Answered
I want to make a continuous sine function
x = -6*pi:pi/10:6*pi; y = sin(x); f = max(sin(x),0); plot(x, f, 'b-o') %remove o if you don't want markers ylim([-0.2 1.2])

3 years ago | 0

| accepted

Answered
Decreasing numbers in matrix (colums and rows)
n = 6; [x,y] = meshgrid(1:n); out = min(x,y)

3 years ago | 1

Answered
Changing the number of rows in a vector by adding repeated rows
%V1 is 76x3 double %random data V1 = rand(76,3); s = size(V1,1); n = 1022; %randomly sorted row indices from 1 to 76 to app...

3 years ago | 0

| accepted

Answered
How to display a linear regression line along with the scatter plot
%Two data x and y x = [0.0630983945707523 0.0569310761963337 0.0902849174433386 0.0586557564536381 0.0334144697267278 0.0712631...

3 years ago | 1

| accepted

Solved


Repeat a string (not a character array)
True string are a relatively recent addition to MATLAB, first having been available in R2016. Strings contrast with character ar...

3 years ago

Answered
Can someone help revise my code? I'm not good with Matlab, I'm trying to implement Newton's method but my code is not working
Your function name is "newton_" but you are calling the function as "newton_raphson". Correct this mis-match and the code sho...

3 years ago | 0

Answered
How do you set entries in a matrix for odd rows with odd columns to zero?
%random data for example A = rand(6,7) A(1:2:end,1:2:end)=0

3 years ago | 0

| accepted

Answered
Angle between multiple unit vectors contained within a matrix.
norm as you have used, outputs the norm of the whole array. If you want to calculate the individual angles between pairs, use v...

3 years ago | 1

| accepted

Solved


New Cody Time-Out Time
Determine the New Cody Time-Out Time Consume the Maximum Possible Time without Timing out. *Score:* 60 (sec) - Time (sec) ...

3 years ago

Solved


Check if a year is a leap year or not
Return 1 if a given year is a leap year or 0 if it is not

3 years ago

Solved


Write a function to calculate step size delta if bits per sample and input range is given for quantization.
numBit = bits per sample; range = input max value - min value; delta = step size; l = number of levels;

3 years ago

Answered
How can I write this with a for loop?
Vectorization would be the best approach here - r = (1./70).*sum(exp(i*Y(:,3:3:210)),2)

3 years ago | 0

Answered
loop for specific values
From the for loop documentation - "To iterate over the values of a single column vector, first transpose it to create a row vect...

3 years ago | 0

Answered
How to append new values from a loop to the bottom of an existing matrix?
Since the data here is quite small, looping twice with 5 elements each, you can make do with pre-allocating as an empty matrix, ...

3 years ago | 1

Answered
I need help with the plotting 3D surface.
Data=[6 100 41.36 6 150 39.26 6 200 37.63 7 100 54.22 7 150 52.26 7 200 50.11 8 100 61.18 8 150 5...

3 years ago | 0

Answered
How do I convert a CSV into a .mat file?
Since the csv only contains numeric data, use readmatrix to load the data in a variable variablename=readmatrix('s1.csv') and ...

3 years ago | 1

| accepted

Answered
How long does the student license last?
MATLAB Pricing and Licensing It shows here that the Student license is Perpetual, meaning you can use it indefinitely (as long ...

3 years ago | 0

Answered
Taylor Series figure problem
The first function definition is incorrect xx = linspace(-pi,pi, 100); syms x %function definition f(x)=(x^2)*sin(x)+exp(-x)...

3 years ago | 1

| accepted

Answered
Vector must be the same length.
I have tidied up your code. Avoid using dynamically named variables as much as you can, it is not recommended, Indexing is much ...

3 years ago | 1

| accepted

Answered
create a vector w1 having the same length as another vector w but containing certain x values
v = [100; 177; 186; 124; 175; 211; 132; 144; 124; 111; 133; 152]; w = [25; 14; 33; 20; 14; 22; 29]; w1=randsample(v,numel(w))

3 years ago | 0

| accepted

Answered
Giving a condition in for loop
p=zeros(1,10); b=0.5; for idx=1:10 a=hypot(x(idx)-x_o,y(idx)-y>o); if a<=b p(setdiff(1:10,idx))=1; end...

3 years ago | 0

| accepted

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values.
The error occurs because your data is not exactly an integer even though it might look like it. %Data displayed in the default ...

3 years ago | 0

| accepted

Solved


Buzz
Dado um nĂºmero inteiro n, retorne 'buzz' se esse valor for multiplo de 5, ou retorne o valor caso contrario. Buzz(5) = 'buzz'; ...

3 years ago

Solved


Logistic map
The sequence defined by x_n = 4*r*x_{n-1}*(1-x_{n-1}) and a given 0 < x_1 < 1 turns each x_n into a polynomial of r. Write a fu...

3 years ago

Solved


Compare a value to a vector
Given a random value X and a random vector Y. you have to compare X to the Vector Y and make a decision. case 1: X is a value i...

3 years ago

Answered
Can't integrate function using Matlab
You will have to explicitly change the function handle to change its definition P=pi; fun = @(x) P*x; P=3; %fun(3) is not eq...

3 years ago | 0

Answered
I am struggling with letter b and keep getting this as an error. Variable b must be of size [1 1]. It is currently of size [3 4]. Check where the variable is assigned a value.
Variable b has been used to store the log10 values of B matrix and it has not been updated afterwards, You have used B instead b...

3 years ago | 1

Load more